Skip to content

Commit

Permalink
Add description to transaction page
Browse files Browse the repository at this point in the history
  • Loading branch information
praslnx8 committed Jan 6, 2024
1 parent 0ba30b7 commit fa39a71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/ui/widgets/create_transaction_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class _CreateTransactionPage extends PageState<CreateTransactionViewState,
});

return AlertDialog(
title: Text('Create Investment',
title: Text('Create Transaction',
style: Theme.of(context).textTheme.titleMedium),
actions: [
ElevatedButton(
Expand Down Expand Up @@ -102,14 +102,15 @@ class _CreateTransactionPage extends PageState<CreateTransactionViewState,
decoration: const InputDecoration(
labelText: 'Description', border: OutlineInputBorder()),
),
const SizedBox(height: AppDimen.defaultPadding),
TextFormField(
textInputAction: TextInputAction.next,
controller: _valueController,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
decoration: const InputDecoration(
labelText: 'Amount', border: OutlineInputBorder()),
),
const SizedBox(height: AppDimen.minPadding),
const SizedBox(height: AppDimen.defaultPadding),
TextFormField(
textInputAction: TextInputAction.next,
controller: _valueUpdatedDateController,
Expand Down
8 changes: 7 additions & 1 deletion lib/ui/widgets/transactions_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ class _TransactionPage extends PageState<TransactionsViewState,
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Date: ${formatDate(transaction.amountInvestedOn)}'),
Row(
children: [
Text(formatDate(transaction.amountInvestedOn)),
const Text(' | '),
Text(transaction.description ?? ''),
],
),
const SizedBox(
height: AppDimen.minPadding), // Add some spacing
Text('Amount: ${formatToCurrency(transaction.amount)}'),
Expand Down

0 comments on commit fa39a71

Please sign in to comment.