changed primary color usage to fix the color bug in dark mode
Changed Theme.of(context).primaryColor to Theme.of(contex).colorScheme.primary to make dark mode work properly.
This commit is contained in:
@@ -13,7 +13,7 @@ class AccountCard extends StatelessWidget {
|
||||
width: 300,
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@@ -33,7 +33,7 @@ class AccountCard extends StatelessWidget {
|
||||
Text(
|
||||
account.accountType,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -42,7 +42,7 @@ class AccountCard extends StatelessWidget {
|
||||
account.accountType == 'Savings'
|
||||
? Icons.savings
|
||||
: Icons.account_balance,
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -50,13 +50,13 @@ class AccountCard extends StatelessWidget {
|
||||
Text(
|
||||
account.accountNumber,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).scaffoldBackgroundColor, fontSize: 16),
|
||||
color: Theme.of(context).colorScheme.onPrimary, fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
'${account.currency} ${account.balance.toStringAsFixed(2)}',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -65,10 +65,11 @@ class AccountCard extends StatelessWidget {
|
||||
Text(
|
||||
AppLocalizations.of(context).availableBalance,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).scaffoldBackgroundColor, fontSize: 16),
|
||||
color: Theme.of(context).colorScheme.onPrimary, fontSize: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user