Theme Colour bugs fixed

This commit is contained in:
2025-08-25 17:47:18 +05:30
parent 04c992c934
commit 180d3a3a60
7 changed files with 70 additions and 50 deletions

View File

@@ -7,6 +7,9 @@
# The following line activates a set of recommended lints for Flutter apps, # The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices. # packages, and plugins designed to encourage good coding practices.
analyzer:
errors:
dead_code: ignore
include: package:flutter_lints/flutter.yaml include: package:flutter_lints/flutter.yaml
linter: linter:

View File

@@ -29,3 +29,5 @@ class ImpsService {
} }
} }
} }

View File

@@ -1,4 +1,5 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:kmobile/data/models/imps_transaction.dart';
import 'package:kmobile/data/models/rtgs_response.dart'; import 'package:kmobile/data/models/rtgs_response.dart';
import 'package:kmobile/data/models/rtgs_transaction.dart'; import 'package:kmobile/data/models/rtgs_transaction.dart';
@@ -28,4 +29,6 @@ class RtgsService {
throw Exception('An unexpected error occurred: ${e.toString()}'); throw Exception('An unexpected error occurred: ${e.toString()}');
} }
} }
processImpsTransaction(ImpsTransaction impsTx) {}
} }

View File

@@ -99,7 +99,7 @@ class _KMobileState extends State<KMobile> {
title: 'kMobile', title: 'kMobile',
theme: themeState.getThemeData(), theme: themeState.getThemeData(),
//darkTheme: themeState.getThemeData(), //darkTheme: themeState.getThemeData(),
themeMode: ThemeMode.system, themeMode: ThemeMode.light,
onGenerateRoute: AppRoutes.generateRoute, onGenerateRoute: AppRoutes.generateRoute,
initialRoute: AppRoutes.splash, initialRoute: AppRoutes.splash,
home: showSplash ? const SplashScreen() : const AuthGate(), home: showSplash ? const SplashScreen() : const AuthGate(),

View File

@@ -2,31 +2,40 @@ import 'package:flutter/material.dart';
import 'theme_type.dart'; import 'theme_type.dart';
class AppThemes { class AppThemes {
static ThemeData getLightTheme(ThemeType type) { static ThemeData getLightTheme(ThemeType type) {
switch (type) { // Define a seed color based on the theme type
case ThemeType.green: final Color seedColor;
return ThemeData(primarySwatch: Colors.green); switch (type) {
case ThemeType.orange: case ThemeType.green:
return ThemeData(primarySwatch: Colors.orange); seedColor = Colors.green;
case ThemeType.blue: break;
return ThemeData(primarySwatch: Colors.blue); case ThemeType.orange:
case ThemeType.violet: seedColor = Colors.orange;
default: break;
return ThemeData(primarySwatch: Colors.deepPurple); case ThemeType.blue:
} seedColor = Colors.blue;
} break;
case ThemeType.violet:
// static ThemeData getDarkTheme(ThemeType type) { default:
// switch (type) { seedColor = Colors.deepPurple;
// case ThemeType.green: break;
// return ThemeData.dark().copyWith(primaryColor: Colors.green); }
// case ThemeType.orange:
// return ThemeData.dark().copyWith(primaryColor: Colors.orange); // Create a ColorScheme from the seed color
// case ThemeType.blue: final colorScheme = ColorScheme.fromSeed(
// return ThemeData.dark().copyWith(primaryColor: Colors.blue); seedColor: seedColor,
// case ThemeType.violet: brightness: Brightness.light, // Explicitly set for a light theme
// default: );
// return ThemeData.dark().copyWith(primaryColor: Colors.deepPurple);
// } // Create the ThemeData from the ColorScheme
// } return ThemeData.from(
colorScheme: colorScheme,
useMaterial3: true, // Recommended for modern Flutter apps
).copyWith(
scaffoldBackgroundColor: Colors.white,
bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: colorScheme.surface,
),
);
}
} }

View File

@@ -262,7 +262,7 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
fontSize: 16, color: Colors.grey[600]), fontSize: 16, color: Colors.grey[600]),
), ),
) )
: ListView.builder( : ListView.separated(
itemCount: _transactions.length, itemCount: _transactions.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final tx = _transactions[index]; final tx = _transactions[index];
@@ -275,21 +275,21 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
tx.type == 'CR' ? Colors.green : Colors.red, tx.type == 'CR' ? Colors.green : Colors.red,
), ),
title: Text( title: Text(
tx.name != null tx.date ?? '',
? (tx.name!.length > 18 style: const TextStyle(fontSize: 15),
? tx.name!.substring(0, 22) ),
: tx.name!) subtitle: Text(
: '', tx.name != null
style: const TextStyle(fontSize: 14), ? (tx.name!.length > 18
), ? tx.name!.substring(0, 22)
subtitle: Text( : tx.name!)
tx.date ?? '', : '',
style: const TextStyle(fontSize: 12), style: const TextStyle(fontSize: 12),
), ),
trailing: Text( trailing: Text(
"${tx.amount}", "${tx.amount}",
style: const TextStyle(fontSize: 16), style: const TextStyle(fontSize: 17),
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@@ -301,6 +301,9 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
}, },
); );
}, },
separatorBuilder: (context, index) {
return const Divider();
},
), ),
), ),
], ],

View File

@@ -572,20 +572,20 @@ class _DashboardScreenState extends State<DashboardScreen> {
tx.type == 'CR' ? Colors.green : Colors.red, tx.type == 'CR' ? Colors.green : Colors.red,
), ),
title: Text( title: Text(
tx.name != null tx.date ?? '',
style: const TextStyle(fontSize: 15),
),
subtitle: Text(
tx.name != null
? (tx.name!.length > 18 ? (tx.name!.length > 18
? tx.name!.substring(0, 22) ? tx.name!.substring(0, 22)
: tx.name!) : tx.name!)
: '', : '',
style: const TextStyle(fontSize: 14),
),
subtitle: Text(
tx.date ?? '',
style: const TextStyle(fontSize: 12), style: const TextStyle(fontSize: 12),
), ),
trailing: Text( trailing: Text(
"${tx.amount}", "${tx.amount}",
style: const TextStyle(fontSize: 16), style: const TextStyle(fontSize: 17),
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(