Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ui adjustments #230

Merged
merged 9 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/features/account/account_balance_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ class AccountBalanceCard extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final pfis = ref.watch(pfisProvider);
final accountBalance = ref.watch(accountBalanceProvider);
// final accountBalance = ref.watch(accountBalanceProvider);

final accountTotal = accountBalance.asData?.value?.total ?? '0';
final accountCurrency = accountBalance.asData?.value?.currencyCode ?? '';
// final accountTotal = accountBalance.asData?.value?.total ?? '0';
// final accountCurrency = accountBalance.asData?.value?.currencyCode ?? '';
const accountTotal = '0';
const accountCurrency = 'USD';

AccountBalanceNotifier getAccountBalanceNotifier() =>
ref.read(accountBalanceProvider.notifier);
Expand Down
2 changes: 1 addition & 1 deletion lib/features/payin/payin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Payin extends HookWidget {
state: state,
keyPress: keyPress,
),
const SizedBox(height: Grid.xs),
const SizedBox(height: Grid.half),
_buildPayinLabel(context),
],
);
Expand Down
15 changes: 9 additions & 6 deletions lib/features/payment/payment_amount_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ class PaymentAmountPage extends HookConsumerWidget {
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: Grid.side,
vertical: Grid.xs,
padding: const EdgeInsets.only(
left: Grid.side,
right: Grid.side,
top: Grid.xxs,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand All @@ -108,7 +109,7 @@ class PaymentAmountPage extends HookConsumerWidget {
transactionType: paymentState.transactionType,
state: state,
),
const SizedBox(height: Grid.xl),
const SizedBox(height: Grid.lg),
PaymentFeeDetails(
transactionType: paymentState.transactionType,
offering: state.value?.selectedOffering?.data,
Expand All @@ -124,7 +125,7 @@ class PaymentAmountPage extends HookConsumerWidget {
keyPress.value = NumberKeyPress(keyPress.value.count + 1, key),
),
),
const SizedBox(height: Grid.sm),
const SizedBox(height: Grid.xs),
NextButton(
onPressed: state.value?.payinAmount == null ||
state.value?.payinAmount == '0'
Expand Down Expand Up @@ -182,7 +183,9 @@ class PaymentAmountPage extends HookConsumerWidget {
state.value = AsyncData(offerings);
}
} on Exception catch (e) {
state.value = AsyncError(e, StackTrace.current);
if (context.mounted) {
state.value = AsyncError(e, StackTrace.current);
}
}
}
}
2 changes: 1 addition & 1 deletion lib/features/payout/payout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Payout extends HookWidget {
_buildPayoutCurrency(context),
],
),
const SizedBox(height: Grid.xs),
const SizedBox(height: Grid.half),
_buildPayoutLabel(context),
],
);
Expand Down
4 changes: 2 additions & 2 deletions lib/features/send/send_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class SendPage extends HookConsumerWidget {
? Padding(
padding: const EdgeInsets.only(left: Grid.xxs),
child: IconButton(
icon: const Icon(Icons.language, size: Grid.lg),
icon: const Icon(Icons.language, size: Grid.md),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const CountriesPage(),
Expand All @@ -99,7 +99,7 @@ class SendPage extends HookConsumerWidget {
Padding(
padding: const EdgeInsets.only(right: Grid.xxs),
child: IconButton(
icon: const Icon(Icons.deblur, size: Grid.lg),
icon: const Icon(Icons.deblur, size: Grid.md),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const LucidOfferingsPage(),
Expand Down
4 changes: 3 additions & 1 deletion lib/features/transaction/transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class Transaction {
? status = TransactionStatus.payoutSuccess
: status = TransactionStatus.payoutCanceled;
break;
case MessageKind.cancel:
status = TransactionStatus.payoutCanceled;
}

if (createdAt.isAfter(latestCreatedAt)) {
Expand Down Expand Up @@ -129,7 +131,7 @@ class Transaction {
case TransactionStatus.payoutComplete:
case TransactionStatus.orderSubmitted:
case null:
return Theme.of(context).colorScheme.outline;
return Theme.of(context).colorScheme.surface;
}
}

Expand Down
8 changes: 7 additions & 1 deletion lib/features/transaction/transaction_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ class TransactionTile extends HookConsumerWidget {
ScaffoldMessenger.of(context).removeCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(transaction.value?.status.toString() ?? ''),
content: Text(
transaction.value?.status.toString() ?? '',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurface,
),
),
behavior: SnackBarBehavior.floating,
duration: const Duration(seconds: 1),
backgroundColor: Transaction.getStatusColor(
context,
Expand Down
6 changes: 4 additions & 2 deletions lib/shared/number/number_pad.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ class _NumberPadKey extends HookWidget {
@override
Widget build(BuildContext context) {
final screenWidth = MediaQuery.of(context).size.width;
const keyHeight = 60.0;
final keyWidth = screenWidth / 4;
final screenHeight = MediaQuery.of(context).size.height;

final keyHeight = screenHeight / 12;
final keyWidth = screenWidth / 3;

const defaultFontSize = 24.0;
const selectedFontSize = 44.0;
Expand Down
2 changes: 1 addition & 1 deletion test/features/home/home_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void main() async {
await tester.pumpWidget(homePageTestWidget());
await tester.pumpAndSettle();

expect(find.widgetWithText(AccountBalanceCard, '101'), findsOneWidget);
expect(find.widgetWithText(AccountBalanceCard, '0'), findsOneWidget);
expect(find.widgetWithText(AccountBalanceCard, 'USD'), findsOneWidget);
});

Expand Down
Loading