Skip to content

Commit

Permalink
Fix: Transaction amount always 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Becker committed Dec 28, 2022
1 parent 50dc6a4 commit 6cdc894
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/game/game_screen/views/widgets/transaction_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,18 @@ class _MoneyAmountInput extends HookWidget {

void submitForm() async {
if (_formKey.currentState!.validate()) {
amountController.clear();
amount.value = 0;

context.popPage();

final result = await context.read<BankingRepository>().makeTransaction(
gameId: game.id,
transactionType: transactionType,
amount: amount.value,
toUserId: toUserId,
);

amountController.clear();
amount.value = 0;

context.popPage();

if (result == MakeTransactionResult.failure) {
await context.showErrorFlashbar(message: 'Transaction failed.');
}
Expand Down

0 comments on commit 6cdc894

Please sign in to comment.