@@ -15,7 +15,6 @@ import '../../widgets/desktop/primary_button.dart';
1515import '../../widgets/dialogs/s_dialog.dart' ;
1616import '../../widgets/rounded_container.dart' ;
1717import '../exchange_view/sub_widgets/step_row.dart' ;
18- import 'shopinbit_step_1.dart' ;
1918import 'shopinbit_step_3.dart' ;
2019import 'shopinbit_step_4.dart' ;
2120
@@ -33,46 +32,19 @@ class ShopInBitStep2 extends StatefulWidget {
3332class _ShopInBitStep2State extends State <ShopInBitStep2 > {
3433 ShopInBitCategory ? _selected;
3534
36- void _popBack () {
37- if (Util .isDesktop) {
38- Navigator .of (context, rootNavigator: true ).pop ();
39- showDialog <void >(
40- context: context,
41- barrierDismissible: false ,
42- builder: (_) => ShopInBitStep1 (model: widget.model),
43- );
44- } else {
45- Navigator .of (context).pop ();
46- }
47- }
48-
4935 void _continue () {
5036 widget.model.category = _selected;
5137 final skipGuidelines = ShopInBitService .instance.loadGuidelinesAccepted ();
5238
53- if (Util .isDesktop) {
54- Navigator .of (context, rootNavigator: true ).pop ();
55- if (skipGuidelines) {
56- widget.model.guidelinesAccepted = true ;
57- Navigator .of (
58- context,
59- ).pushNamed (ShopInBitStep4 .routeName, arguments: widget.model);
60- } else {
61- Navigator .of (
62- context,
63- ).pushNamed (ShopInBitStep3 .routeName, arguments: widget.model);
64- }
39+ if (skipGuidelines) {
40+ widget.model.guidelinesAccepted = true ;
41+ Navigator .of (
42+ context,
43+ ).pushNamed (ShopInBitStep4 .routeName, arguments: widget.model);
6544 } else {
66- if (skipGuidelines) {
67- widget.model.guidelinesAccepted = true ;
68- Navigator .of (
69- context,
70- ).pushNamed (ShopInBitStep4 .routeName, arguments: widget.model);
71- } else {
72- Navigator .of (
73- context,
74- ).pushNamed (ShopInBitStep3 .routeName, arguments: widget.model);
75- }
45+ Navigator .of (
46+ context,
47+ ).pushNamed (ShopInBitStep3 .routeName, arguments: widget.model);
7648 }
7749 }
7850
@@ -101,11 +73,7 @@ class _ShopInBitStep2State extends State<ShopInBitStep2> {
10173 children: [
10274 Row (
10375 children: [
104- AppBarBackButton (
105- isCompact: true ,
106- iconSize: 23 ,
107- onPressed: _popBack,
108- ),
76+ const AppBarBackButton (isCompact: true , iconSize: 23 ),
10977 Text ("ShopinBit" , style: STextStyles .desktopH3 (context)),
11078 ],
11179 ),
@@ -125,40 +93,29 @@ class _ShopInBitStep2State extends State<ShopInBitStep2> {
12593 child: ConditionalParent (
12694 condition: ! isDesktop,
12795 builder: (content) => Background (
128- child: PopScope (
129- canPop: false ,
130- onPopInvokedWithResult: (bool didPop, dynamic result) {
131- if (! didPop) {
132- _popBack ();
133- }
134- },
135- child: Scaffold (
136- backgroundColor: Theme .of (
137- context,
138- ).extension < StackColors > ()! .background,
139- appBar: AppBar (
140- leading: AppBarBackButton (onPressed: _popBack),
141- title: Text (
142- "ShopinBit" ,
143- style: STextStyles .navBarTitle (context),
144- ),
145- ),
146- body: SafeArea (
147- child: LayoutBuilder (
148- builder: (context, constraints) {
149- return Padding (
150- padding: const EdgeInsets .all (16 ),
151- child: SingleChildScrollView (
152- child: ConstrainedBox (
153- constraints: BoxConstraints (
154- minHeight: constraints.maxHeight - 32 ,
155- ),
156- child: IntrinsicHeight (child: content),
96+ child: Scaffold (
97+ backgroundColor: Theme .of (
98+ context,
99+ ).extension < StackColors > ()! .background,
100+ appBar: AppBar (
101+ leading: const AppBarBackButton (),
102+ title: Text ("ShopinBit" , style: STextStyles .navBarTitle (context)),
103+ ),
104+ body: SafeArea (
105+ child: LayoutBuilder (
106+ builder: (context, constraints) {
107+ return Padding (
108+ padding: const EdgeInsets .all (16 ),
109+ child: SingleChildScrollView (
110+ child: ConstrainedBox (
111+ constraints: BoxConstraints (
112+ minHeight: constraints.maxHeight - 32 ,
157113 ),
114+ child: IntrinsicHeight (child: content),
158115 ),
159- );
160- },
161- ) ,
116+ ),
117+ );
118+ } ,
162119 ),
163120 ),
164121 ),
0 commit comments