Skip to content
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
12 changes: 8 additions & 4 deletions lib/features/exchange/ui/screens/exchange_home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ class ExchangeHomeScreen extends StatelessWidget {
onPressed: () => context.pushNamed(
FundExchangeRoute.fundExchangeAccount.name,
),
bgColor: context.appColors.secondary,
textColor: context.appColors.onSecondary,
bgColor: context.appColors.secondaryFixed,
textColor: context.appColors.onSecondaryFixed,
outlined: true,
borderColor: context.appColors.onSecondaryFixed,
),
),
const Gap(4),
Expand All @@ -220,8 +222,10 @@ class ExchangeHomeScreen extends StatelessWidget {
disabled: false,
onPressed: () =>
context.pushNamed(WithdrawRoute.withdraw.name),
bgColor: context.appColors.secondary,
textColor: context.appColors.onSecondary,
bgColor: context.appColors.secondaryFixed,
textColor: context.appColors.onSecondaryFixed,
outlined: true,
borderColor: context.appColors.onSecondaryFixed,
),
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PayExternalWalletNetworkSelectionScreen extends StatelessWidget {
),
const Gap(24.0),
ListTile(
tileColor: context.appColors.onPrimary,
tileColor: context.appColors.onSecondary,
shape: const Border(),
title: Text(context.loc.payBitcoinOnchain),
trailing: const Icon(Icons.chevron_right),
Expand All @@ -57,7 +57,7 @@ class PayExternalWalletNetworkSelectionScreen extends StatelessWidget {
),
const Gap(24.0),
ListTile(
tileColor: context.appColors.onPrimary,
tileColor: context.appColors.onSecondary,
shape: const Border(),
title: Text(context.loc.payLightningNetwork),
trailing: const Icon(Icons.chevron_right),
Expand All @@ -72,7 +72,7 @@ class PayExternalWalletNetworkSelectionScreen extends StatelessWidget {
),
const Gap(24.0),
ListTile(
tileColor: context.appColors.onPrimary,
tileColor: context.appColors.onSecondary,
shape: const Border(),
title: Text(context.loc.payLiquidNetwork),
trailing: const Icon(Icons.chevron_right),
Expand Down
5 changes: 3 additions & 2 deletions lib/features/pay/ui/screens/pay_receive_payment_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class PayReceivePaymentScreen extends StatelessWidget {
child: BBText(
context.loc.payPleasePayInvoice,
style: context.font.headlineMedium,
color: context.appColors.secondary,
),
),
Center(
Expand Down Expand Up @@ -247,7 +248,7 @@ class PayReceivePaymentScreen extends StatelessWidget {
BBText(
label,
style: context.font.bodyMedium?.copyWith(
color: context.appColors.surfaceContainer,
color: context.appColors.onSurfaceVariant,
),
),
const Spacer(),
Expand All @@ -261,7 +262,7 @@ class PayReceivePaymentScreen extends StatelessWidget {
textAlign: .end,
maxLines: 2,
style: context.font.bodyMedium?.copyWith(
color: isError ? context.appColors.error : null,
color: isError ? context.appColors.error : context.appColors.secondary,
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/features/pay/ui/screens/pay_send_payment_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class _DetailRow extends StatelessWidget {
Widget build(BuildContext context) {
final valueColor =
onTap == null
? context.appColors.outlineVariant
? context.appColors.secondary
: context.appColors.primary;

return Padding(
Expand All @@ -303,7 +303,7 @@ class _DetailRow extends StatelessWidget {
Text(
title,
style: context.font.bodyMedium?.copyWith(
color: context.appColors.surfaceContainer,
color: context.appColors.onSurfaceVariant,
),
),
Expanded(
Expand Down
3 changes: 2 additions & 1 deletion lib/features/pay/ui/screens/pay_success_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ class PaySuccessScreen extends StatelessWidget {
context.pushNamed(
TransactionsRoute.orderTransactionDetails.name,
pathParameters: {'orderId': order.orderId},
queryParameters: {'returnToExchange': 'true'},
);
},
bgColor: context.appColors.secondary,
textColor: context.appColors.onPrimary,
textColor: context.appColors.onSecondary,
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class PayWalletSelectionScreen extends StatelessWidget {
),
const Gap(24.0),
ListTile(
tileColor: context.appColors.onPrimary,
tileColor: context.appColors.onSecondary,
shape: const Border(),
title: Text(context.loc.payExternalWallet),
subtitle: Text(context.loc.payExternalWalletDescription),
Expand Down
6 changes: 5 additions & 1 deletion lib/features/pay/ui/widgets/pay_qr_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class PayQrBottomSheet extends StatelessWidget {
Row(
mainAxisAlignment: .spaceBetween,
children: [
BBText(context.loc.payQrCode, style: context.font.headlineSmall),
BBText(
context.loc.payQrCode,
style: context.font.headlineSmall,
color: context.appColors.secondary,
),
IconButton(
onPressed: () => Navigator.of(context).pop(),
icon: const Icon(Icons.close),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class BBTextFormField extends StatelessWidget {
fillColor:
isDisabled
? context.appColors.surfaceContainerHighest
: context.appColors.onPrimary,
: context.appColors.onSecondary,
filled: true,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RecipientTypeSelector extends StatelessWidget {
} else {
return Material(
elevation: 4,
color: context.appColors.onPrimary,
color: context.appColors.onSecondary,
borderRadius: BorderRadius.circular(4.0),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class RecipientsListTile extends StatelessWidget {
? context.appColors.primary
: context.appColors.surface,
),
color: context.appColors.onPrimary,
color: context.appColors.onSecondary,
),
child: Column(
crossAxisAlignment: .start,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SellExternalWalletNetworkSelectionScreen extends StatelessWidget {
),
const Gap(24.0),
ListTile(
tileColor: context.appColors.onPrimary,
tileColor: context.appColors.onSecondary,
shape: const Border(),
title: Text(context.loc.sellBitcoinOnChain),
trailing: const Icon(Icons.chevron_right),
Expand All @@ -57,7 +57,7 @@ class SellExternalWalletNetworkSelectionScreen extends StatelessWidget {
),
const Gap(24.0),
ListTile(
tileColor: context.appColors.onPrimary,
tileColor: context.appColors.onSecondary,
shape: const Border(),
title: Text(context.loc.sellLightningNetwork),
trailing: const Icon(Icons.chevron_right),
Expand All @@ -72,7 +72,7 @@ class SellExternalWalletNetworkSelectionScreen extends StatelessWidget {
),
const Gap(24.0),
ListTile(
tileColor: context.appColors.onPrimary,
tileColor: context.appColors.onSecondary,
shape: const Border(),
title: Text(context.loc.sellLiquidNetwork),
trailing: const Icon(Icons.chevron_right),
Expand Down
5 changes: 3 additions & 2 deletions lib/features/sell/ui/screens/sell_receive_payment_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class SellReceivePaymentScreen extends StatelessWidget {
child: BBText(
context.loc.sellPleasePayInvoice,
style: context.font.headlineMedium,
color: context.appColors.secondary,
),
),
Center(
Expand Down Expand Up @@ -221,7 +222,7 @@ class SellReceivePaymentScreen extends StatelessWidget {
BBText(
label,
style: context.font.bodyMedium?.copyWith(
color: context.appColors.surfaceContainer,
color: context.appColors.onSurfaceVariant,
),
),
const Spacer(),
Expand All @@ -235,7 +236,7 @@ class SellReceivePaymentScreen extends StatelessWidget {
textAlign: .end,
maxLines: 2,
style: context.font.bodyMedium?.copyWith(
color: isError ? context.appColors.error : null,
color: isError ? context.appColors.error : context.appColors.secondary,
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/features/sell/ui/screens/sell_send_payment_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class _DetailRow extends StatelessWidget {
Text(
title,
style: context.font.bodyMedium?.copyWith(
color: context.appColors.surfaceContainer,
color: context.appColors.onSurfaceVariant,
),
),
Expanded(
Expand All @@ -246,7 +246,7 @@ class _DetailRow extends StatelessWidget {
textAlign: .end,
maxLines: 2,
style: context.font.bodyMedium?.copyWith(
color: valueColor,
color: context.appColors.secondary,
),
),
),
Expand Down
16 changes: 10 additions & 6 deletions lib/features/sell/ui/screens/sell_success_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ class SellSuccessScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final order = context.select(
(SellBloc bloc) =>
bloc.state is SellSuccessState
? (bloc.state as SellSuccessState).sellOrder
: null,
(SellBloc bloc) => bloc.state is SellSuccessState
? (bloc.state as SellSuccessState).sellOrder
: null,
);
return PopScope(
canPop: false,
Expand All @@ -42,7 +41,11 @@ class SellSuccessScreen extends StatelessWidget {
child: Column(
mainAxisAlignment: .center,
children: [
Icon(Icons.check_circle, size: 100, color: context.appColors.success),
Icon(
Icons.check_circle,
size: 100,
color: context.appColors.success,
),
const SizedBox(height: 20),
Text(
context.loc.sellOrderCompleted,
Expand Down Expand Up @@ -71,10 +74,11 @@ class SellSuccessScreen extends StatelessWidget {
context.pushNamed(
TransactionsRoute.orderTransactionDetails.name,
pathParameters: {'orderId': order.orderId},
queryParameters: {'returnToExchange': 'true'},
);
},
bgColor: context.appColors.secondary,
textColor: context.appColors.onPrimary,
textColor: context.appColors.onSecondary,
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SellWalletSelectionScreen extends StatelessWidget {
),
const Gap(24.0),
ListTile(
tileColor: context.appColors.onPrimary,
tileColor: context.appColors.onSecondary,
shape: const Border(),
title: Text(context.loc.sellExternalWallet),
subtitle: Text(context.loc.sellFromAnotherWallet),
Expand Down
6 changes: 5 additions & 1 deletion lib/features/sell/ui/widgets/sell_qr_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class SellQrBottomSheet extends StatelessWidget {
Row(
mainAxisAlignment: .spaceBetween,
children: [
BBText(context.loc.sellQrCode, style: context.font.headlineSmall),
BBText(
context.loc.sellQrCode,
style: context.font.headlineSmall,
color: context.appColors.secondary,
),
IconButton(
onPressed: () => Navigator.of(context).pop(),
icon: const Icon(Icons.close),
Expand Down
33 changes: 25 additions & 8 deletions lib/features/send/presentation/bloc/send_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1434,13 +1434,19 @@ class SendCubit extends Cubit<SendState> {
0, // TODO (ishi): removed until server fees are implemented
);
}
// await Future.delayed(const Duration(seconds: 3));
// Start syncing the wallet now that the transaction is confirmed
await _getWalletUsecase.execute(state.selectedWallet!.id, sync: true);

emit(
state.copyWith(broadcastingTransaction: false, step: SendStep.success),
);

unawaited(
_getWalletUsecase
.execute(state.selectedWallet!.id, sync: true)
.catchError((e) {
log.warning('Failed to sync wallet after broadcast: $e');
return null;
}),
);
} on GetWalletException catch (e) {
emit(
state.copyWith(
Expand Down Expand Up @@ -1532,7 +1538,6 @@ class SendCubit extends Cubit<SendState> {
}

void _watchSendSwap(String swapId) {
// Cancel the previous subscription if it exists
_swapSubscription?.cancel();
_swapSubscription = _watchSwapUsecase.execute(swapId).listen((updatedSwap) {
log.info(
Expand All @@ -1542,17 +1547,29 @@ class SendCubit extends Cubit<SendState> {
emit(state.copyWith(lightningSwap: updatedSwap));
if (updatedSwap.status == SwapStatus.canCoop ||
updatedSwap.status == SwapStatus.completed) {
// Start syncing the wallet now that the swap is completed
_getWalletUsecase.execute(state.selectedWallet!.id, sync: true);
emit(state.copyWith(step: SendStep.success));
unawaited(
_getWalletUsecase
.execute(state.selectedWallet!.id, sync: true)
.catchError((e) {
log.warning('Failed to sync wallet after swap completed: $e');
return null;
}),
);
}
}
if (updatedSwap is ChainSwap) {
emit(state.copyWith(chainSwap: updatedSwap));
if (updatedSwap.status == SwapStatus.completed) {
// Start syncing the wallet now that the swap is completed
_getWalletUsecase.execute(state.selectedWallet!.id, sync: true);
emit(state.copyWith(step: SendStep.success));
unawaited(
_getWalletUsecase
.execute(state.selectedWallet!.id, sync: true)
.catchError((e) {
log.warning('Failed to sync wallet after swap completed: $e');
return null;
}),
);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ExchangeAccountInfoScreen extends StatelessWidget {
BBText(
label,
style: context.font.headlineMedium?.copyWith(
color: context.appColors.onSurface,
color: context.appColors.onSurfaceVariant,
fontWeight: .w500,
),
),
Expand All @@ -124,7 +124,7 @@ class ExchangeAccountInfoScreen extends StatelessWidget {
BBText(
value,
style: context.font.bodyLarge?.copyWith(
color: context.appColors.onSurface,
color: context.appColors.secondary,
fontWeight: .w700,
),
),
Expand Down Expand Up @@ -173,7 +173,7 @@ class ExchangeAccountInfoScreen extends StatelessWidget {
BBText(
value,
style: context.font.bodyLarge?.copyWith(
color: context.appColors.onSurface,
color: context.appColors.secondary,
fontWeight: .w700,
),
),
Expand Down
Loading