@@ -6,8 +6,6 @@ import 'package:bb_mobile/features/buy/ui/buy_router.dart';
66import 'package:bb_mobile/features/exchange/presentation/exchange_cubit.dart' ;
77import 'package:bb_mobile/features/exchange/ui/exchange_router.dart' ;
88import 'package:bb_mobile/features/pay/ui/pay_router.dart' ;
9- import 'package:bb_mobile/features/recipients/frameworks/ui/routing/recipients_router.dart' ;
10- import 'package:bb_mobile/features/recipients/interface_adapters/presenters/models/recipient_view_model.dart' ;
119import 'package:bb_mobile/features/sell/ui/sell_router.dart' ;
1210import 'package:bb_mobile/features/settings/presentation/bloc/settings_cubit.dart' ;
1311import 'package:bb_mobile/features/swap/ui/swap_router.dart' ;
@@ -37,10 +35,7 @@ class _ActionRow extends StatelessWidget {
3735 decoration: BoxDecoration (
3836 color: context.appColors.background,
3937 border: Border (
40- bottom: BorderSide (
41- color: context.appColors.outline,
42- width: 1 ,
43- ),
38+ bottom: BorderSide (color: context.appColors.outline, width: 1 ),
4439 ),
4540 ),
4641 child: Material (
@@ -50,116 +45,92 @@ class _ActionRow extends StatelessWidget {
5045 child: SizedBox (
5146 height: 80 ,
5247 child: Row (
53- children: [
54- _ActionButton (
55- icon: Assets .icons.btc.path,
56- label: 'Buy' ,
57- onPressed: () {
58- if (Platform .isIOS) {
59- final isSuperuser =
60- context.read <SettingsCubit >().state.isSuperuser ?? false ;
61- if (isSuperuser) {
62- context.pushNamed (BuyRoute .buy.name);
63- } else {
64- context.goNamed (ExchangeRoute .exchangeLanding.name);
65- }
66- } else {
67- context.pushNamed (BuyRoute .buy.name);
68- }
69- },
70- position: _ButtonPosition .first,
71- disabled: false ,
72- ),
73- const Gap (1 ),
74- _ActionButton (
75- icon: Assets .icons.dollar.path,
76- label: 'Sell' ,
77- onPressed: () {
78- if (Platform .isIOS) {
79- final isSuperuser =
80- context.read <SettingsCubit >().state.isSuperuser ?? false ;
81- if (isSuperuser) {
82- context.pushNamed (SellRoute .sell.name);
48+ children: [
49+ _ActionButton (
50+ icon: Assets .icons.btc.path,
51+ label: 'Buy' ,
52+ onPressed: () {
53+ if (Platform .isIOS) {
54+ final isSuperuser =
55+ context.read <SettingsCubit >().state.isSuperuser ??
56+ false ;
57+ if (isSuperuser) {
58+ context.pushNamed (BuyRoute .buy.name);
59+ } else {
60+ context.goNamed (ExchangeRoute .exchangeLanding.name);
61+ }
8362 } else {
84- context.goNamed ( ExchangeRoute .exchangeLanding .name);
63+ context.pushNamed ( BuyRoute .buy .name);
8564 }
86- } else {
87- context.pushNamed (SellRoute .sell.name);
88- }
89- },
90- position: _ButtonPosition .middle,
91- disabled: false ,
92- ),
93- const Gap (1 ),
94- _ActionButton (
95- icon: Assets .icons.rightArrow.path,
96- label: 'Pay' ,
97- onPressed: () {
98- final notLoggedIn =
99- context.read <ExchangeCubit >().state.notLoggedIn;
100-
101- if (notLoggedIn) {
102- context.goNamed (ExchangeRoute .exchangeLanding.name);
103- } else {
65+ },
66+ position: _ButtonPosition .first,
67+ disabled: false ,
68+ ),
69+ const Gap (1 ),
70+ _ActionButton (
71+ icon: Assets .icons.dollar.path,
72+ label: 'Sell' ,
73+ onPressed: () {
10474 if (Platform .isIOS) {
10575 final isSuperuser =
10676 context.read <SettingsCubit >().state.isSuperuser ??
10777 false ;
10878 if (isSuperuser) {
109- // Reuse the recipients screen to select a recipient before
110- // navigating to the Pay screen.
111- context.pushNamed (
112- RecipientsRoute .recipients.name,
113- extra: RecipientsRouteExtra (
114- onRecipientSelected: (
115- RecipientViewModel recipient,
116- ) async {
117- await context.pushNamed (
118- PayRoute .pay.name,
119- extra: recipient,
120- );
121- },
122- ),
123- );
79+ context.pushNamed (SellRoute .sell.name);
12480 } else {
12581 context.goNamed (ExchangeRoute .exchangeLanding.name);
12682 }
12783 } else {
128- // Reuse the recipients screen to select a recipient before
129- // navigating to the Pay screen.
130- context.pushNamed (
131- RecipientsRoute .recipients.name,
132- extra: RecipientsRouteExtra (
133- onRecipientSelected: (
134- RecipientViewModel recipient,
135- ) async {
136- await context.pushNamed (
137- PayRoute .pay.name,
138- extra: recipient,
139- );
140- },
141- ),
142- );
84+ context.pushNamed (SellRoute .sell.name);
85+ }
86+ },
87+ position: _ButtonPosition .middle,
88+ disabled: false ,
89+ ),
90+ const Gap (1 ),
91+ _ActionButton (
92+ icon: Assets .icons.rightArrow.path,
93+ label: 'Pay' ,
94+ onPressed: () {
95+ final notLoggedIn = context
96+ .read <ExchangeCubit >()
97+ .state
98+ .notLoggedIn;
99+
100+ if (notLoggedIn) {
101+ context.goNamed (ExchangeRoute .exchangeLanding.name);
102+ } else {
103+ if (Platform .isIOS) {
104+ final isSuperuser =
105+ context.read <SettingsCubit >().state.isSuperuser ??
106+ false ;
107+ if (isSuperuser) {
108+ context.pushNamed (PayRoute .pay.name);
109+ } else {
110+ context.goNamed (ExchangeRoute .exchangeLanding.name);
111+ }
112+ } else {
113+ context.pushNamed (PayRoute .pay.name);
114+ }
143115 }
144- }
145- } ,
146- position : _ButtonPosition .middle ,
147- disabled : false ,
148- ),
149- const Gap ( 1 ),
150- _ActionButton (
151- icon : Assets .icons.swap.path ,
152- label : 'Transfer' ,
153- onPressed : () {
154- context. pushNamed ( SwapRoute .swap.name);
155- } ,
156- position : _ButtonPosition .last ,
157- disabled : false ,
158- ) ,
159- ] ,
116+ },
117+ position : _ButtonPosition .middle ,
118+ disabled : false ,
119+ ) ,
120+ const Gap ( 1 ),
121+ _ActionButton (
122+ icon : Assets .icons.swap.path,
123+ label : 'Transfer' ,
124+ onPressed : () {
125+ context. pushNamed ( SwapRoute .swap.name);
126+ },
127+ position : _ButtonPosition .last ,
128+ disabled : false ,
129+ ) ,
130+ ] ,
131+ ) ,
160132 ),
161133 ),
162- ),
163134 );
164135 }
165136}
0 commit comments