Skip to content

Commit 28f495c

Browse files
committed
fix(ui): More shopinbit stuff, navigation fixes, styling, etc etc. Probably still a WIP
1 parent e955542 commit 28f495c

8 files changed

Lines changed: 400 additions & 379 deletions

lib/pages/shopinbit/shopinbit_car_fee_view.dart

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ import '../../utilities/text_styles.dart';
2020
import '../../utilities/util.dart';
2121
import '../../widgets/background.dart';
2222
import '../../widgets/custom_buttons/app_bar_icon_button.dart';
23-
import '../../widgets/desktop/desktop_dialog.dart';
2423
import '../../widgets/desktop/desktop_dialog_close_button.dart';
2524
import '../../widgets/desktop/primary_button.dart';
25+
import '../../widgets/dialogs/nested_navigator_dialog/nested_navigator_dialog.dart';
26+
import '../../widgets/dialogs/s_dialog.dart';
2627
import '../../widgets/rounded_white_container.dart';
2728
import '../../widgets/textfields/adaptive_text_field.dart';
2829
import '../more_view/services_view.dart';
@@ -286,25 +287,12 @@ class _ShopInBitCarFeeViewState extends ConsumerState<ShopInBitCarFeeView> {
286287

287288
if (!mounted) return;
288289

289-
if (Util.isDesktop) {
290-
Navigator.of(context, rootNavigator: true).pop();
291-
unawaited(
292-
showDialog<void>(
293-
context: context,
294-
builder: (_) => ShopInBitCarResearchPaymentView(
295-
model: widget.model,
296-
invoice: invoice,
297-
),
298-
),
299-
);
300-
} else {
301-
unawaited(
302-
Navigator.of(context).pushNamed(
303-
ShopInBitCarResearchPaymentView.routeName,
304-
arguments: (widget.model, invoice),
305-
),
306-
);
307-
}
290+
unawaited(
291+
Navigator.of(context).pushNamed(
292+
ShopInBitCarResearchPaymentView.routeName,
293+
arguments: (widget.model, invoice),
294+
),
295+
);
308296
} catch (e) {
309297
if (mounted) {
310298
setState(() => _submitting = false);
@@ -504,6 +492,7 @@ class _ShopInBitCarFeeViewState extends ConsumerState<ShopInBitCarFeeView> {
504492
final spacing = SizedBox(height: isDesktop ? 16 : 12);
505493

506494
final content = Column(
495+
mainAxisSize: .min,
507496
crossAxisAlignment: CrossAxisAlignment.stretch,
508497
children: [
509498
Text(
@@ -514,6 +503,9 @@ class _ShopInBitCarFeeViewState extends ConsumerState<ShopInBitCarFeeView> {
514503
),
515504
SizedBox(height: isDesktop ? 16 : 8),
516505
RoundedWhiteContainer(
506+
borderColor: isDesktop
507+
? Theme.of(context).extension<StackColors>()!.textFieldDefaultBG
508+
: null,
517509
child: Row(
518510
mainAxisAlignment: MainAxisAlignment.spaceBetween,
519511
children: [
@@ -705,34 +697,41 @@ class _ShopInBitCarFeeViewState extends ConsumerState<ShopInBitCarFeeView> {
705697
);
706698

707699
if (isDesktop) {
708-
return DesktopDialog(
709-
maxWidth: 580,
710-
maxHeight: 750,
711-
child: Column(
712-
children: [
713-
Row(
714-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
715-
children: [
716-
Padding(
717-
padding: const EdgeInsets.only(left: 32),
718-
child: Text(
719-
"ShopinBit",
720-
style: STextStyles.desktopH3(context),
700+
return SDialog(
701+
child: SizedBox(
702+
width: 580,
703+
child: Column(
704+
mainAxisSize: .min,
705+
children: [
706+
Row(
707+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
708+
children: [
709+
Padding(
710+
padding: const EdgeInsets.only(left: 32),
711+
child: Text(
712+
"ShopinBit",
713+
style: STextStyles.desktopH3(context),
714+
),
721715
),
716+
DesktopDialogCloseButton(
717+
onPressedOverride: () =>
718+
NestedNavigatorDialog.of(context).close(),
719+
),
720+
],
721+
),
722+
Flexible(
723+
child: Padding(
724+
padding: const .only(
725+
left: 32,
726+
right: 32,
727+
bottom: 32,
728+
top: 16,
729+
),
730+
child: content,
722731
),
723-
const DesktopDialogCloseButton(),
724-
],
725-
),
726-
Expanded(
727-
child: Padding(
728-
padding: const EdgeInsets.symmetric(
729-
horizontal: 32,
730-
vertical: 16,
731-
),
732-
child: SingleChildScrollView(child: content),
733732
),
734-
),
735-
],
733+
],
734+
),
736735
),
737736
);
738737
}

lib/pages/shopinbit/shopinbit_car_research_payment_view.dart

Lines changed: 54 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import '../../utilities/util.dart';
2323
import '../../wallets/crypto_currency/crypto_currency.dart';
2424
import '../../widgets/background.dart';
2525
import '../../widgets/custom_buttons/app_bar_icon_button.dart';
26-
import '../../widgets/desktop/desktop_dialog.dart';
2726
import '../../widgets/desktop/desktop_dialog_close_button.dart';
2827
import '../../widgets/desktop/primary_button.dart';
2928
import '../../widgets/desktop/secondary_button.dart';
29+
import '../../widgets/dialogs/s_dialog.dart';
3030
import '../../widgets/qr.dart';
3131
import '../../widgets/rounded_white_container.dart';
3232
import '../../widgets/stack_dialog.dart';
@@ -407,22 +407,13 @@ class _ShopInBitCarResearchPaymentViewState
407407
// Both steps already done: navigate to success directly.
408408
if (!mounted) return;
409409
setState(() => _flowState = _PaymentFlowState.complete);
410-
if (Util.isDesktop) {
411-
Navigator.of(context, rootNavigator: true).pop();
412-
unawaited(
413-
showDialog<void>(
414-
context: context,
415-
builder: (_) => ShopInBitOrderCreated(model: widget.model),
416-
),
417-
);
418-
} else {
419-
unawaited(
420-
Navigator.of(context).pushNamed(
421-
ShopInBitOrderCreated.routeName,
422-
arguments: widget.model,
423-
),
424-
);
425-
}
410+
411+
unawaited(
412+
Navigator.of(
413+
context,
414+
).pushNamed(ShopInBitOrderCreated.routeName, arguments: widget.model),
415+
);
416+
426417
return;
427418
}
428419
// Fee logged; skip to createRequest.
@@ -495,22 +486,12 @@ class _ShopInBitCarResearchPaymentViewState
495486
}
496487
if (!mounted) return;
497488
setState(() => _flowState = _PaymentFlowState.complete);
498-
if (Util.isDesktop) {
499-
Navigator.of(context, rootNavigator: true).pop();
500-
unawaited(
501-
showDialog<void>(
502-
context: context,
503-
builder: (_) => ShopInBitOrderCreated(model: widget.model),
504-
),
505-
);
506-
} else {
507-
unawaited(
508-
Navigator.of(context).pushNamed(
509-
ShopInBitOrderCreated.routeName,
510-
arguments: widget.model,
511-
),
512-
);
513-
}
489+
490+
unawaited(
491+
Navigator.of(
492+
context,
493+
).pushNamed(ShopInBitOrderCreated.routeName, arguments: widget.model),
494+
);
514495
} catch (e) {
515496
if (mounted) {
516497
setState(() => _flowState = _PaymentFlowState.error);
@@ -630,21 +611,11 @@ class _ShopInBitCarResearchPaymentViewState
630611
if (!mounted) return;
631612
setState(() => _flowState = _PaymentFlowState.complete);
632613

633-
if (Util.isDesktop) {
634-
Navigator.of(context, rootNavigator: true).pop();
635-
unawaited(
636-
showDialog<void>(
637-
context: context,
638-
builder: (_) => ShopInBitOrderCreated(model: widget.model),
639-
),
640-
);
641-
} else {
642-
unawaited(
643-
Navigator.of(
644-
context,
645-
).pushNamed(ShopInBitOrderCreated.routeName, arguments: widget.model),
646-
);
647-
}
614+
unawaited(
615+
Navigator.of(
616+
context,
617+
).pushNamed(ShopInBitOrderCreated.routeName, arguments: widget.model),
618+
);
648619
} catch (e) {
649620
if (mounted) {
650621
setState(() => _flowState = _PaymentFlowState.error);
@@ -719,21 +690,11 @@ class _ShopInBitCarResearchPaymentViewState
719690
if (!mounted) return;
720691
setState(() => _flowState = _PaymentFlowState.complete);
721692

722-
if (Util.isDesktop) {
723-
Navigator.of(context, rootNavigator: true).pop();
724-
unawaited(
725-
showDialog<void>(
726-
context: context,
727-
builder: (_) => ShopInBitOrderCreated(model: widget.model),
728-
),
729-
);
730-
} else {
731-
unawaited(
732-
Navigator.of(
733-
context,
734-
).pushNamed(ShopInBitOrderCreated.routeName, arguments: widget.model),
735-
);
736-
}
693+
unawaited(
694+
Navigator.of(
695+
context,
696+
).pushNamed(ShopInBitOrderCreated.routeName, arguments: widget.model),
697+
);
737698
} catch (e) {
738699
if (mounted) {
739700
setState(() => _flowState = _PaymentFlowState.error);
@@ -848,6 +809,7 @@ class _ShopInBitCarResearchPaymentViewState
848809

849810
final content = Column(
850811
crossAxisAlignment: CrossAxisAlignment.stretch,
812+
mainAxisSize: .min,
851813
children: [
852814
Text(
853815
"Car research payment",
@@ -987,34 +949,38 @@ class _ShopInBitCarResearchPaymentViewState
987949
);
988950

989951
if (isDesktop) {
990-
return DesktopDialog(
991-
maxWidth: 580,
992-
maxHeight: 750,
993-
child: Column(
994-
children: [
995-
Row(
996-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
997-
children: [
998-
Padding(
999-
padding: const EdgeInsets.only(left: 32),
1000-
child: Text(
1001-
"ShopinBit",
1002-
style: STextStyles.desktopH3(context),
952+
return SDialog(
953+
child: SizedBox(
954+
width: 580,
955+
child: Column(
956+
mainAxisSize: .min,
957+
children: [
958+
Row(
959+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
960+
children: [
961+
Padding(
962+
padding: const EdgeInsets.only(left: 32),
963+
child: Text(
964+
"ShopinBit",
965+
style: STextStyles.desktopH3(context),
966+
),
1003967
),
968+
const DesktopDialogCloseButton(),
969+
],
970+
),
971+
Flexible(
972+
child: Padding(
973+
padding: const .only(
974+
left: 32,
975+
right: 32,
976+
bottom: 32,
977+
top: 16,
978+
),
979+
child: content,
1004980
),
1005-
const DesktopDialogCloseButton(),
1006-
],
1007-
),
1008-
Expanded(
1009-
child: Padding(
1010-
padding: const EdgeInsets.symmetric(
1011-
horizontal: 32,
1012-
vertical: 16,
1013-
),
1014-
child: SingleChildScrollView(child: content),
1015981
),
1016-
),
1017-
],
982+
],
983+
),
1018984
),
1019985
);
1020986
}

0 commit comments

Comments
 (0)