Extras removed
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -42,6 +42,10 @@ class _AccountInfoScreen extends State<AccountInfoScreen> {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -75,7 +75,7 @@ class _CardManagementScreen extends State<CardManagementScreen> {
|
||||
),
|
||||
);
|
||||
},
|
||||
disabled: true,
|
||||
disabled: false,
|
||||
),
|
||||
Divider(height: 1, color: Theme.of(context).dividerColor),
|
||||
],
|
||||
|
||||
@@ -73,7 +73,7 @@ class _CustomerInfoScreenState extends State<CustomerInfoScreen> {
|
||||
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,
|
||||
|
||||
@@ -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<DashboardScreen>
|
||||
bool isRefreshing = false;
|
||||
|
||||
bool _biometricPromptShown = false;
|
||||
bool _txLoading = false;
|
||||
List<Transaction> _transactions = [];
|
||||
bool _txInitialized = false;
|
||||
PageController? _pageController;
|
||||
final routeObserver = getIt<RouteObserver<ModalRoute<void>>>();
|
||||
@@ -105,7 +99,7 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
Icons.arrow_forward,
|
||||
Icons.arrow_forward_ios,
|
||||
size: 16,
|
||||
),
|
||||
],
|
||||
@@ -266,39 +260,6 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _loadTransactions(String accountNo) async {
|
||||
setState(() {
|
||||
_txLoading = true;
|
||||
_transactions = [];
|
||||
});
|
||||
try {
|
||||
final repo = getIt<TransactionRepository>();
|
||||
final txs = await repo.fetchTransactions(accountNo);
|
||||
var fiveTxns = <Transaction>[];
|
||||
//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<void> _refreshAccountData(BuildContext context) async {
|
||||
setState(() {
|
||||
isRefreshing = true;
|
||||
@@ -373,6 +334,10 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
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<DashboardScreen>
|
||||
if (!_txInitialized) {
|
||||
_txInitialized = true;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_loadTransactions(currAccount.accountNo!);
|
||||
});
|
||||
}
|
||||
_pageController ??= PageController(
|
||||
@@ -569,10 +533,6 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||
setState(() {
|
||||
selectedAccountIndex = newIndex;
|
||||
});
|
||||
|
||||
await _loadTransactions(
|
||||
users[newIndex].accountNo!,
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
final user = users[index];
|
||||
|
||||
@@ -163,157 +163,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
// @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<String>(
|
||||
// future: _getAppVersion(),
|
||||
// builder:
|
||||
// (BuildContext context, AsyncSnapshot<String> 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<bool>(
|
||||
// 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<bool>(
|
||||
// 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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user