feat: Implement major features and fix theming bug

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.
This commit is contained in:
asif
2025-08-11 04:06:05 +05:30
parent 3024ddef15
commit f91d0f739b
34 changed files with 1638 additions and 911 deletions

View File

@@ -1,48 +1,25 @@
import 'dart:developer';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'theme_state.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(ThemeViolet()) {
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 isDark = prefs.getBool('is_dark_mode') ?? false;
final type = ThemeType.values[themeIndex];
switch(type) {
case ThemeType.blue:
emit(ThemeBlue());
case ThemeType.violet:
emit(ThemeViolet());
default:
emit(ThemeViolet());
}
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);
log("Mode Change");
print("mode changed");
switch(type) {
case ThemeType.blue:
emit(ThemeBlue());
print('blue matched');
break;
case ThemeType.violet:
emit(ThemeViolet());
print('violet matched');
break;
default:
emit(ThemeBlue());
print('default macthed');
}
emit(ThemeState(themeType: type));
}
}

View File

@@ -1,27 +1,17 @@
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:kmobile/config/theme_type.dart';
import 'package:kmobile/config/themes.dart';
class ThemeState extends Equatable {
final ThemeType themeType;
abstract class ThemeState extends Equatable {
getThemeData();
@override
List<Object?> get props => [];
}
const ThemeState({required this.themeType});
class ThemeBlue extends ThemeState {
@override
getThemeData() {
print('returning blue theme');
return AppThemes.getLightTheme(ThemeType.blue);
ThemeData getThemeData() {
return AppThemes.getLightTheme(themeType);
}
}
class ThemeViolet extends ThemeState {
@override
getThemeData() {
print('returning violet theme');
return AppThemes.getLightTheme(ThemeType.violet);
}
}
List<Object?> get props => [themeType];
}