Skip to content

Commit a304fb8

Browse files
committed
fix: fix total saving not updating
1 parent 57df6d6 commit a304fb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/features/wish_detail/widget/my_expandable_fab.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class MyExpandableFab extends StatelessWidget {
4343
onSubmit: () => context.read<WishBloc>().add(const TakeSavingEvent()),
4444
formKey: formKey,
4545
validator: (value) {
46-
if (int.parse((value).replaceAll('.', '')) > wish.getTotalSaving()) {
46+
if (int.parse((value).replaceAll('.', '')) > context.read<WishBloc>().state.wish.getTotalSaving()) {
4747
return 'Nominal tidak boleh melebihi total tabungan terkumpul';
4848
}
4949
return null;
@@ -65,7 +65,7 @@ class MyExpandableFab extends StatelessWidget {
6565
onSubmit: () => context.read<WishBloc>().add(const AddSavingEvent()),
6666
formKey: formKey,
6767
validator: (value) {
68-
if (int.parse((value).replaceAll('.', '')) > wish.savingTarget - wish.getTotalSaving()) {
68+
if (int.parse((value).replaceAll('.', '')) > wish.savingTarget - context.read<WishBloc>().state.wish.getTotalSaving()) {
6969
return 'Nominal yang ditabung melebihi kekurangan';
7070
}
7171
return null;

0 commit comments

Comments
 (0)