This commit introduces several new features and a critical bug fix. - Implemented a full "Quick Pay" flow for both within and outside the bank, including IFSC validation, beneficiary verification, and a TPIN-based payment process. - Added a date range filter to the Account Statement screen and streamlined the UI by removing the amount filters. - Fixed a major bug that prevented dynamic theme changes from being applied. The app now correctly switches between color themes. - Refactored and improved beneficiary management, transaction models, and the fund transfer flow to support NEFT/RTGS.
26 lines
833 B
Dart
26 lines
833 B
Dart
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:kmobile/config/theme_type.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
import 'theme_state.dart';
|
|
|
|
class ThemeCubit extends Cubit<ThemeState> {
|
|
ThemeCubit() : super(const ThemeState(themeType: ThemeType.violet)) {
|
|
loadTheme();
|
|
}
|
|
|
|
Future<void> loadTheme() async {
|
|
final prefs = await SharedPreferences.getInstance();
|
|
final themeIndex = prefs.getInt('theme_type') ?? 0;
|
|
final type = ThemeType.values[themeIndex];
|
|
emit(ThemeState(themeType: type));
|
|
}
|
|
|
|
Future<void> changeTheme(ThemeType type) async {
|
|
print("Attempting to change theme to: ${type.toString()}");
|
|
final prefs = await SharedPreferences.getInstance();
|
|
await prefs.setInt('theme_type', type.index);
|
|
emit(ThemeState(themeType: type));
|
|
}
|
|
}
|