Skip to content

Commit

Permalink
fix on tap more frequent catogories/accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
JokerZenDev committed Feb 4, 2024
1 parent 8cb0d8f commit ffdc06b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 52 deletions.
58 changes: 32 additions & 26 deletions lib/pages/add_page/widgets/account_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,33 +71,39 @@ class _AccountSelectorState extends ConsumerState<AccountSelector> with Function
BankAccount account = accounts[i];
IconData? icon = accountIconList[account.symbol];
Color? color = accountColorListTheme[account.color];
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: color,
return GestureDetector(
onTap: () => {
ref.read(widget.provider.notifier).state = account,
Navigator.of(context).pop(),
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: color,
),
padding: const EdgeInsets.all(10.0),
child: icon != null
? Icon(
icon,
size: 24.0,
color: Theme.of(context).colorScheme.background,
)
: const SizedBox(),
),
padding: const EdgeInsets.all(10.0),
child: icon != null
? Icon(
icon,
size: 24.0,
color: Theme.of(context).colorScheme.background,
)
: const SizedBox(),
),
Text(
account.name,
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(color: Theme.of(context).colorScheme.primary),
),
],
Text(
account.name,
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(color: Theme.of(context).colorScheme.primary),
),
],
),
),
);
},
Expand Down
59 changes: 33 additions & 26 deletions lib/pages/add_page/widgets/category_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,33 +67,40 @@ class _CategorySelectorState extends ConsumerState<CategorySelector> with Functi
CategoryTransaction category = categories[i];
IconData? icon = iconList[category.symbol];
Color? color = categoryColorListTheme[category.color];
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: color,
return GestureDetector(
onTap: () => {
ref.read(categoryProvider.notifier).state =
category,
Navigator.of(context).pop(),
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: color,
),
padding: const EdgeInsets.all(10.0),
child: icon != null
? Icon(
icon,
size: 24.0,
color: Theme.of(context).colorScheme.background,
)
: const SizedBox(),
),
padding: const EdgeInsets.all(10.0),
child: icon != null
? Icon(
icon,
size: 24.0,
color: Theme.of(context).colorScheme.background,
)
: const SizedBox(),
),
Text(
category.name,
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(color: Theme.of(context).colorScheme.primary),
),
],
Text(
category.name,
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(color: Theme.of(context).colorScheme.primary),
),
],
),
),
);
},
Expand Down

0 comments on commit ffdc06b

Please sign in to comment.