From b19bc2e2220971da19fc25aab2f7cefc49efabdf Mon Sep 17 00:00:00 2001 From: Nilanjan Chakrabarti Date: Thu, 27 Nov 2025 11:47:39 +0530 Subject: [PATCH] Extras removed --- lib/di/injection.dart | 4 +- .../accounts/screens/account_info_screen.dart | 4 + .../card/screens/card_details_screen.dart | 16 +- .../card/screens/card_management_screen.dart | 2 +- .../screens/customer_info_screen.dart | 2 +- .../dashboard/screens/dashboard_screen.dart | 50 +----- lib/features/profile/profile_screen.dart | 147 ------------------ .../service/screens/atm_locator_screen.dart | 1 - .../screens/branch_locator_screen.dart | 1 - .../service/screens/service_screen.dart | 2 - 10 files changed, 14 insertions(+), 215 deletions(-) diff --git a/lib/di/injection.dart b/lib/di/injection.dart index 9f650de..e3eba3a 100644 --- a/lib/di/injection.dart +++ b/lib/di/injection.dart @@ -74,9 +74,9 @@ Dio _createDioClient() { final dio = Dio( BaseOptions( baseUrl: - // 'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', //test + 'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', //test //'http://lb-kccb-mobile-banking-app-848675342.ap-south-1.elb.amazonaws.com', //prod - 'https://kccbmbnk.net', //prod small + //'https://kccbmbnk.net', //prod small connectTimeout: const Duration(seconds: 60), receiveTimeout: const Duration(seconds: 60), headers: { diff --git a/lib/features/accounts/screens/account_info_screen.dart b/lib/features/accounts/screens/account_info_screen.dart index d578eaa..9eea9f5 100644 --- a/lib/features/accounts/screens/account_info_screen.dart +++ b/lib/features/accounts/screens/account_info_screen.dart @@ -42,6 +42,10 @@ class _AccountInfoScreen extends State { return AppLocalizations.of(context).recurringDeposit; case 'ca': return "Current Account"; + case 'cc': + return "Cash Credit Account"; + case 'od': + return "Overdraft Account"; default: return AppLocalizations.of(context).unknownAccount; } diff --git a/lib/features/card/screens/card_details_screen.dart b/lib/features/card/screens/card_details_screen.dart index 8eb31fd..d3583b2 100644 --- a/lib/features/card/screens/card_details_screen.dart +++ b/lib/features/card/screens/card_details_screen.dart @@ -33,20 +33,6 @@ class CardDetailsScreen extends StatelessWidget { ], ), ), - IgnorePointer( - child: Center( - child: Opacity( - opacity: 0.07, // Reduced opacity - child: ClipOval( - child: Image.asset( - 'assets/images/logo.png', - width: 200, // Adjust size as needed - height: 200, // Adjust size as needed - ), - ), - ), - ), - ), ], ), ); @@ -105,7 +91,7 @@ class CardTile extends StatelessWidget { "Kangra Central Co-operative Bank", style: TextStyle( color: Colors.white, - fontSize: 18, + fontSize: 15.5, fontWeight: FontWeight.bold, ), overflow: TextOverflow.ellipsis, diff --git a/lib/features/card/screens/card_management_screen.dart b/lib/features/card/screens/card_management_screen.dart index 5ca282c..1243f84 100644 --- a/lib/features/card/screens/card_management_screen.dart +++ b/lib/features/card/screens/card_management_screen.dart @@ -75,7 +75,7 @@ class _CardManagementScreen extends State { ), ); }, - disabled: true, + disabled: false, ), Divider(height: 1, color: Theme.of(context).dividerColor), ], diff --git a/lib/features/customer_info/screens/customer_info_screen.dart b/lib/features/customer_info/screens/customer_info_screen.dart index 313734a..c4ccf5c 100644 --- a/lib/features/customer_info/screens/customer_info_screen.dart +++ b/lib/features/customer_info/screens/customer_info_screen.dart @@ -73,7 +73,7 @@ class _CustomerInfoScreenState extends State { const SizedBox(height: 30), InfoField( label: AppLocalizations.of(context).activeAccounts, - value: user.activeAccounts?.toString() ?? '6', + value: user.activeAccounts?.toString() ?? 'N/A', ), InfoField( label: AppLocalizations.of(context).mobileNumber, diff --git a/lib/features/dashboard/screens/dashboard_screen.dart b/lib/features/dashboard/screens/dashboard_screen.dart index 8400269..6077bb7 100644 --- a/lib/features/dashboard/screens/dashboard_screen.dart +++ b/lib/features/dashboard/screens/dashboard_screen.dart @@ -1,14 +1,11 @@ -import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/svg.dart'; import 'package:kmobile/data/models/user.dart'; -import 'package:kmobile/data/repositories/transaction_repository.dart'; import 'package:kmobile/di/injection.dart'; import 'package:kmobile/features/accounts/screens/account_info_screen.dart'; import 'package:kmobile/features/accounts/screens/account_statement_screen.dart'; import 'package:kmobile/features/accounts/screens/all_accounts_screen.dart'; -import 'package:kmobile/features/accounts/screens/transaction_details_screen.dart'; import 'package:kmobile/features/auth/controllers/auth_cubit.dart'; import 'package:kmobile/features/auth/controllers/auth_state.dart'; import 'package:kmobile/features/customer_info/screens/customer_info_screen.dart'; @@ -24,7 +21,6 @@ import 'package:local_auth/local_auth.dart'; import 'package:material_symbols_icons/material_symbols_icons.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:shimmer/shimmer.dart'; -import 'package:kmobile/data/models/transaction.dart'; import '../../../l10n/app_localizations.dart'; class DashboardScreen extends StatefulWidget { @@ -41,8 +37,6 @@ class _DashboardScreenState extends State bool isRefreshing = false; bool _biometricPromptShown = false; - bool _txLoading = false; - List _transactions = []; bool _txInitialized = false; PageController? _pageController; final routeObserver = getIt>>(); @@ -105,7 +99,7 @@ class _DashboardScreenState extends State ), ), Icon( - Icons.arrow_forward, + Icons.arrow_forward_ios, size: 16, ), ], @@ -266,39 +260,6 @@ class _DashboardScreenState extends State ); } - Future _loadTransactions(String accountNo) async { - setState(() { - _txLoading = true; - _transactions = []; - }); - try { - final repo = getIt(); - final txs = await repo.fetchTransactions(accountNo); - var fiveTxns = []; - //only take the first 5 transactions - if (txs.length > 5) { - fiveTxns = txs.sublist(0, 5); - } else { - fiveTxns = txs; - } - setState(() => _transactions = fiveTxns); - } catch (e) { - log(accountNo, error: e); - if (!mounted) return; - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - AppLocalizations.of(context).failedToLoad(e.toString()), - ), - ), - ); - } finally { - if (mounted) { - setState(() => _txLoading = false); - } - } - } - Future _refreshAccountData(BuildContext context) async { setState(() { isRefreshing = true; @@ -373,6 +334,10 @@ class _DashboardScreenState extends State return AppLocalizations.of(context).recurringDeposit; case 'ca': return "Current Account"; + case 'cc': + return "Cash Credit Account"; + case 'od': + return "Overdraft Account"; default: return AppLocalizations.of(context).unknownAccount; } @@ -507,7 +472,6 @@ class _DashboardScreenState extends State if (!_txInitialized) { _txInitialized = true; WidgetsBinding.instance.addPostFrameCallback((_) { - _loadTransactions(currAccount.accountNo!); }); } _pageController ??= PageController( @@ -569,10 +533,6 @@ class _DashboardScreenState extends State setState(() { selectedAccountIndex = newIndex; }); - - await _loadTransactions( - users[newIndex].accountNo!, - ); }, itemBuilder: (context, index) { final user = users[index]; diff --git a/lib/features/profile/profile_screen.dart b/lib/features/profile/profile_screen.dart index b131c52..378332a 100644 --- a/lib/features/profile/profile_screen.dart +++ b/lib/features/profile/profile_screen.dart @@ -163,157 +163,10 @@ class _ProfileScreenState extends State { } } - // @override - // Widget build(BuildContext context) { - // final loc = AppLocalizations.of(context); - - // return Scaffold( - // appBar: AppBar( - // title: Text(loc.profile), // Localized "Profile" - // ), - // body: Stack( - // children: [ - // ListView( - // children: [ - // ListTile( - // leading: const Icon(Icons.settings), - // title: Text(loc.preferences), - // trailing: const Icon(Icons.chevron_right), - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => const PreferenceScreen()), - // ); - // }, - // ), - // ListTile( - // leading: const Icon(Icons.security), - // title: Text(loc.securitySettings), - // trailing: const Icon(Icons.chevron_right), - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => SecuritySettingsScreen( - // mobileNumber: widget.mobileNumber, - // ), - // ), - // ); - // }, - // ), - // ListTile( - // leading: const Icon(Icons.currency_rupee), - // title: Text(AppLocalizations.of(context).dailylimit), - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => const DailyLimitScreen()), - // ); - // }, - // ), - // SwitchListTile( - // title: - // Text(AppLocalizations.of(context).enableFingerprintLogin), - // value: _isBiometricEnabled, - // onChanged: (bool value) { - // // The state is now managed within _handleBiometricToggle - // _handleBiometricToggle(value); - // }, - // secondary: const Icon(Icons.fingerprint), - // ), - // ListTile( - // leading: const Icon(Icons.smartphone), - // title: const Text("App Version"), - // trailing: FutureBuilder( - // future: _getAppVersion(), - // builder: - // (BuildContext context, AsyncSnapshot snapshot) { - // if (snapshot.connectionState == ConnectionState.waiting) { - // // Show a loading indicator while waiting for the future to complete - // return const CircularProgressIndicator(); - // } else if (snapshot.hasError) { - // return const Text("Error"); - // } else { - // // Display the version number once the future is complete - // return Text( - // snapshot.data ?? "N/A", - // selectionColor: const Color(0xFFFFFFFF), - // ); - // } - // }, - // ), - // ), - // ListTile( - // leading: const Icon(Icons.exit_to_app), - // title: Text(AppLocalizations.of(context).logout), - // onTap: () async { - // final shouldExit = await showDialog( - // context: context, - // builder: (context) => AlertDialog( - // title: Text(AppLocalizations.of(context).logout), - // content: Text(AppLocalizations.of(context).logoutCheck), - // actions: [ - // TextButton( - // onPressed: () => Navigator.of(context).pop(false), - // child: Text(AppLocalizations.of(context).no), - // ), - // TextButton( - // onPressed: () => Navigator.of(context).pop(true), - // child: Text(AppLocalizations.of(context).yes), - // ), - // ], - // ), - // ); - - // if (shouldExit == true) { - // if (Platform.isAndroid) { - // SystemNavigator.pop(); - // } - // exit(0); - // } - // }, - // ), - // ListTile( - // leading: const Icon(Icons.logout), - // title: Text(AppLocalizations.of(context).deregister), - // onTap: () async { - // final shouldLogout = await showDialog( - // context: context, - // builder: (_) => const LogoutDialog(), - // ); - - // if (shouldLogout == true) { - // await _handleLogout(context); - // } - // }, - // ), - // ], - // ), - // IgnorePointer( - // child: Center( - // child: Opacity( - // opacity: 0.07, // Reduced opacity - // child: ClipOval( - // child: Image.asset( - // 'assets/images/logo.png', - // width: 200, // Adjust size as needed - // height: 200, // Adjust size as needed - // ), - // ), - // ), - // ), - // ), - // ], - // ), - // ); - // } @override Widget build(BuildContext context) { final loc = AppLocalizations.of(context); final theme = Theme.of(context); - final isDarkMode = theme.brightness == Brightness.dark; return Scaffold( appBar: AppBar( diff --git a/lib/features/service/screens/atm_locator_screen.dart b/lib/features/service/screens/atm_locator_screen.dart index 9e2d70d..9d4092b 100644 --- a/lib/features/service/screens/atm_locator_screen.dart +++ b/lib/features/service/screens/atm_locator_screen.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import '../../../l10n/app_localizations.dart'; import 'package:kmobile/api/services/branch_service.dart'; // Added: Import BranchService for Atm model and API calls import 'package:kmobile/di/injection.dart'; // Added: Import for dependency injection (getIt) import 'package:shimmer/shimmer.dart'; // Added: Import for shimmer loading effect diff --git a/lib/features/service/screens/branch_locator_screen.dart b/lib/features/service/screens/branch_locator_screen.dart index 12124fd..5cbb5d4 100644 --- a/lib/features/service/screens/branch_locator_screen.dart +++ b/lib/features/service/screens/branch_locator_screen.dart @@ -1,7 +1,6 @@ // ignore_for_file: unused_element import 'package:flutter/material.dart'; -import '../../../l10n/app_localizations.dart'; import 'package:kmobile/api/services/branch_service.dart'; import 'package:kmobile/di/injection.dart'; import 'package:shimmer/shimmer.dart'; diff --git a/lib/features/service/screens/service_screen.dart b/lib/features/service/screens/service_screen.dart index 251ef9e..cc1dfd2 100644 --- a/lib/features/service/screens/service_screen.dart +++ b/lib/features/service/screens/service_screen.dart @@ -1,6 +1,4 @@ import 'package:kmobile/features/service/screens/atm_locator_screen.dart'; -import 'package:kmobile/features/service/screens/branch_locator_screen.dart'; - import '../../../l10n/app_localizations.dart'; import 'package:flutter/material.dart'; import 'package:material_symbols_icons/material_symbols_icons.dart';