@@ -68,6 +68,8 @@ import '../../widgets/background.dart';
6868import '../../widgets/custom_buttons/app_bar_icon_button.dart' ;
6969import '../../widgets/custom_buttons/blue_text_button.dart' ;
7070import '../../widgets/dialogs/firo_exchange_address_dialog.dart' ;
71+ import '../../widgets/dialogs/s_dialog.dart' ;
72+ import '../../widgets/desktop/secondary_button.dart' ;
7173import '../../widgets/epic_txs_method_toggle.dart' ;
7274import '../../widgets/eth_fee_form.dart' ;
7375import '../../widgets/fee_slider.dart' ;
@@ -82,7 +84,7 @@ import '../../widgets/stack_text_field.dart';
8284import '../../widgets/textfield_icon_button.dart' ;
8385import '../address_book_views/address_book_view.dart' ;
8486import '../coin_control/coin_control_view.dart' ;
85- import '../masternodes/masternodes_home_view .dart' ;
87+ import '../masternodes/masternode_constants .dart' ;
8688import 'confirm_transaction_view.dart' ;
8789import 'sub_widgets/building_transaction_dialog.dart' ;
8890import 'sub_widgets/dual_balance_selection_sheet.dart' ;
@@ -311,30 +313,52 @@ class _SendViewState extends ConsumerState<SendView> {
311313
312314 final selectedAddress = await showDialog <String >(
313315 context: context,
314- builder: (ctx) => AlertDialog (
315- title: const Text ("Choose your address" ),
316- content: SizedBox (
317- width: 520 ,
318- child: ListView .builder (
319- shrinkWrap: true ,
320- itemCount: addresses.length,
321- itemBuilder: (_, index) => ListTile (
322- contentPadding: EdgeInsets .zero,
323- title: Text (
324- addresses[index],
325- maxLines: 1 ,
326- overflow: TextOverflow .ellipsis,
316+ builder: (ctx) => SDialog (
317+ contentCanScroll: false ,
318+ padding: EdgeInsets .all (Util .isDesktop ? 32 : 16 ),
319+ child: SizedBox (
320+ width: Util .isDesktop ? 520 : null ,
321+ child: Column (
322+ mainAxisSize: MainAxisSize .min,
323+ crossAxisAlignment: CrossAxisAlignment .stretch,
324+ children: [
325+ Text (
326+ "Choose your address" ,
327+ style: Util .isDesktop
328+ ? STextStyles .desktopH3 (ctx)
329+ : STextStyles .pageTitleH2 (ctx),
327330 ),
328- onTap: () => Navigator .of (ctx).pop (addresses[index]),
329- ),
331+ const SizedBox (height: 16 ),
332+ ConstrainedBox (
333+ constraints: BoxConstraints (
334+ maxHeight: MediaQuery .of (ctx).size.height * 0.5 ,
335+ ),
336+ child: ListView .builder (
337+ shrinkWrap: true ,
338+ itemCount: addresses.length,
339+ itemBuilder: (_, index) => ListTile (
340+ contentPadding: EdgeInsets .zero,
341+ title: Text (
342+ addresses[index],
343+ maxLines: 1 ,
344+ overflow: TextOverflow .ellipsis,
345+ style: Util .isDesktop
346+ ? STextStyles .w500_16 (ctx)
347+ : STextStyles .w500_14 (ctx),
348+ ),
349+ onTap: () => Navigator .of (ctx).pop (addresses[index]),
350+ ),
351+ ),
352+ ),
353+ const SizedBox (height: 16 ),
354+ SecondaryButton (
355+ buttonHeight: ButtonHeight .l,
356+ label: "Cancel" ,
357+ onPressed: () => Navigator .of (ctx).pop (),
358+ ),
359+ ],
330360 ),
331361 ),
332- actions: [
333- TextButton (
334- onPressed: () => Navigator .of (ctx).pop (),
335- child: const Text ("Cancel" ),
336- ),
337- ],
338362 ),
339363 );
340364
@@ -947,14 +971,13 @@ class _SendViewState extends ConsumerState<SendView> {
947971 }
948972 }
949973
950- final shouldShowBuildingDialog = mounted && ! Util .isDesktop;
951- bool wasCancelled = false ;
952974 try {
953- if (shouldShowBuildingDialog) {
975+ bool wasCancelled = false ;
976+
977+ if (mounted) {
954978 unawaited (
955979 showDialog <void >(
956980 context: context,
957- useRootNavigator: false ,
958981 useSafeArea: false ,
959982 barrierDismissible: false ,
960983 builder: (context) {
@@ -966,13 +989,17 @@ class _SendViewState extends ConsumerState<SendView> {
966989 BalanceType .private,
967990 onCancel: () {
968991 wasCancelled = true ;
992+
993+ Navigator .of (context).pop ();
969994 },
970995 );
971996 },
972997 ),
973998 );
974999 }
9751000
1001+ final time = Future <dynamic >.delayed (const Duration (milliseconds: 2500 ));
1002+
9761003 Future <TxData > txDataFuture;
9771004
9781005 if (isPaynymSend) {
@@ -1122,27 +1149,9 @@ class _SendViewState extends ConsumerState<SendView> {
11221149 );
11231150 }
11241151
1125- TxData txData;
1126- if (Util .isDesktop && mounted) {
1127- Exception ? buildEx;
1128- final desktopResult = await showLoading <TxData >(
1129- whileFuture: txDataFuture,
1130- context: context,
1131- message: "Generating transaction..." ,
1132- delay: const Duration (milliseconds: 2500 ),
1133- rootNavigator: true ,
1134- onException: (e) => buildEx = e,
1135- );
1136- if (buildEx != null ) throw buildEx! ;
1137- if (desktopResult == null || ! mounted) return ;
1138- txData = desktopResult;
1139- } else {
1140- final time = Future <dynamic >.delayed (
1141- const Duration (milliseconds: 2500 ),
1142- );
1143- final results = await Future .wait ([txDataFuture, time]);
1144- txData = results.first as TxData ;
1145- }
1152+ final results = await Future .wait ([txDataFuture, time]);
1153+
1154+ TxData txData = results.first as TxData ;
11461155
11471156 if (! wasCancelled && mounted) {
11481157 if (isPaynymSend) {
@@ -1157,10 +1166,8 @@ class _SendViewState extends ConsumerState<SendView> {
11571166 txData = txData.copyWith (noteOnChain: onChainNoteController.text);
11581167 }
11591168
1160- if (shouldShowBuildingDialog) {
1161- // pop building dialog
1162- Navigator .of (context, rootNavigator: false ).pop ();
1163- }
1169+ // pop building dialog
1170+ Navigator .of (context).pop ();
11641171
11651172 unawaited (
11661173 Navigator .of (context).push (
@@ -1186,10 +1193,8 @@ class _SendViewState extends ConsumerState<SendView> {
11861193 } catch (e, s) {
11871194 Logging .instance.e ("$e \n $s " , error: e, stackTrace: s);
11881195 if (mounted) {
1189- if (shouldShowBuildingDialog && ! wasCancelled) {
1190- // pop building dialog
1191- Navigator .of (context, rootNavigator: false ).pop ();
1192- }
1196+ // pop building dialog
1197+ Navigator .of (context).pop ();
11931198
11941199 unawaited (
11951200 showDialog <dynamic >(
@@ -1370,10 +1375,9 @@ class _SendViewState extends ConsumerState<SendView> {
13701375 walletId = widget.walletId;
13711376 clipboard = widget.clipboard;
13721377 _isMasternodeCollateralUnshield =
1373- (_data? .note.contains ("Masternode collateral unshield" ) ?? false ) &&
1374- isFiro;
1378+ MasternodeCollateralNotes .isUnshield (_data? .note) && isFiro;
13751379 _isMasternodeCollateralSelfSend =
1376- ((_data? .note. contains ( "Masternode collateral prep" ) ?? false ) ||
1380+ (MasternodeCollateralNotes . isPrep (_data? .note) ||
13771381 _isMasternodeCollateralUnshield) &&
13781382 isFiro;
13791383
0 commit comments