Skip to content

Commit

Permalink
Merge pull request #148 from JokerZenDev/issue-147
Browse files Browse the repository at this point in the history
fix on tap more frequent catogories/accounts
  • Loading branch information
mikev-cw authored Feb 8, 2024
2 parents 366238e + ffdc06b commit fc3c316
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 fc3c316

Please sign in to comment.