fixed some warnings and colors in the dashboard screen

This commit is contained in:
asif
2025-08-29 21:28:45 +05:30
parent da0287ef38
commit f934f0bff6

View File

@@ -94,13 +94,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
Widget _buildBalanceShimmer() {
final theme = Theme.of(context);
return Shimmer.fromColors(
baseColor: Theme.of(context).dialogBackgroundColor,
highlightColor: Theme.of(context).dialogBackgroundColor,
baseColor: theme.primaryColor,
highlightColor: theme.colorScheme.onPrimary,
child: Container(
width: 100,
height: 32,
color: Theme.of(context).scaffoldBackgroundColor),
width: 200, height: 42, color: theme.scaffoldBackgroundColor),
);
}
@@ -190,6 +189,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return BlocListener<AuthCubit, AuthState>(
listener: (context, state) async {
if (state is Authenticated && !_biometricPromptShown) {
@@ -202,14 +202,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
},
child: Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
backgroundColor: theme.scaffoldBackgroundColor,
appBar: AppBar(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
backgroundColor: theme.scaffoldBackgroundColor,
automaticallyImplyLeading: false,
title: Text(
AppLocalizations.of(context).kconnect,
style: TextStyle(
color: Theme.of(context).primaryColor,
color: theme.primaryColor,
fontWeight: FontWeight.w500,
),
),
@@ -271,7 +271,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
"${AppLocalizations.of(context).hi} $firstName",
style: GoogleFonts.montserrat().copyWith(
fontSize: 25,
color: Theme.of(context).primaryColor,
color: theme.primaryColor,
fontWeight: FontWeight.w700,
),
),
@@ -285,7 +285,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
vertical: 10,
),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
color: theme.primaryColor,
borderRadius: BorderRadius.circular(16),
),
child: Column(
@@ -296,21 +296,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
Text(
"${AppLocalizations.of(context).accountNumber}: ",
style: TextStyle(
color:
Theme.of(context).dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
fontSize: 12,
),
),
DropdownButton<int>(
value: selectedAccountIndex,
dropdownColor: Theme.of(context).primaryColor,
dropdownColor: theme.primaryColor,
underline: const SizedBox(),
icon: const Icon(Icons.keyboard_arrow_down),
iconEnabledColor:
Theme.of(context).dialogBackgroundColor,
iconEnabledColor: theme.colorScheme.onPrimary,
style: TextStyle(
color:
Theme.of(context).dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
fontSize: 14,
),
items: List.generate(users.length, (index) {
@@ -319,8 +316,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Text(
users[index].accountNo ?? 'N/A',
style: TextStyle(
color: Theme.of(context)
.dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
fontSize: 14,
),
),
@@ -360,15 +356,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: 20,
height: 20,
child: CircularProgressIndicator(
color: Theme.of(context)
.dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
strokeWidth: 2,
),
)
: Icon(
Icons.refresh,
color: Theme.of(context)
.dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
),
onPressed: isRefreshing
? null
@@ -380,7 +374,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Text(
getFullAccountType(currAccount.accountType),
style: TextStyle(
color: Theme.of(context).dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
fontSize: 16,
),
),
@@ -391,8 +385,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Text(
"",
style: TextStyle(
color:
Theme.of(context).dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
fontSize: 40,
fontWeight: FontWeight.w700,
),
@@ -405,8 +398,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
'0.00'
: '********',
style: TextStyle(
color: Theme.of(context)
.dialogBackgroundColor,
color: theme.colorScheme.onPrimary,
fontSize: 40,
fontWeight: FontWeight.w700,
),
@@ -436,8 +428,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
isVisible
? Symbols.visibility_lock
: Symbols.visibility,
color: Theme.of(context)
.scaffoldBackgroundColor,
color: theme.scaffoldBackgroundColor,
weight: 800,
),
),
],
@@ -627,30 +619,26 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
List<Widget> _buildTransactionShimmer() {
final theme = Theme.of(context);
return List.generate(3, (i) {
return ListTile(
leading: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: CircleAvatar(
radius: 12,
backgroundColor: Theme.of(context).scaffoldBackgroundColor),
radius: 12, backgroundColor: theme.scaffoldBackgroundColor),
),
title: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
height: 10,
width: 100,
color: Theme.of(context).scaffoldBackgroundColor),
height: 10, width: 100, color: theme.scaffoldBackgroundColor),
),
subtitle: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
height: 8,
width: 60,
color: Theme.of(context).scaffoldBackgroundColor),
height: 8, width: 60, color: theme.scaffoldBackgroundColor),
),
);
});
@@ -662,6 +650,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
VoidCallback onTap, {
bool disable = false,
}) {
final theme = Theme.of(context);
return InkWell(
onTap: disable ? null : onTap,
child: Column(