11import 'package:flutter/material.dart' ;
22import 'package:stackwallet/utilities/text_styles.dart' ;
33import 'package:stackwallet/utilities/theme/stack_colors.dart' ;
4+ import 'package:stackwallet/utilities/util.dart' ;
5+ import 'package:stackwallet/widgets/desktop/desktop_dialog.dart' ;
6+ import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart' ;
7+ import 'package:stackwallet/widgets/desktop/primary_button.dart' ;
8+ import 'package:stackwallet/widgets/desktop/secondary_button.dart' ;
49import 'package:stackwallet/widgets/stack_dialog.dart' ;
510
611class ConfirmFullRescanDialog extends StatelessWidget {
@@ -11,40 +16,110 @@ class ConfirmFullRescanDialog extends StatelessWidget {
1116
1217 @override
1318 Widget build (BuildContext context) {
14- return WillPopScope (
15- onWillPop: () async {
16- return true ;
17- },
18- child: StackDialog (
19- title: "Rescan blockchain" ,
20- message:
21- "Warning! It may take a while. If you exit before completion, you will have to redo the process." ,
22- leftButton: TextButton (
23- style: Theme .of (context)
24- .extension < StackColors > ()!
25- .getSecondaryEnabledButtonColor (context),
26- child: Text (
27- "Cancel" ,
28- style: STextStyles .itemSubtitle12 (context),
29- ),
30- onPressed: () {
31- Navigator .of (context).pop ();
32- },
19+ if (Util .isDesktop) {
20+ return DesktopDialog (
21+ maxWidth: 576 ,
22+ child: Column (
23+ mainAxisSize: MainAxisSize .min,
24+ children: [
25+ Row (
26+ mainAxisAlignment: MainAxisAlignment .spaceBetween,
27+ children: [
28+ Padding (
29+ padding: const EdgeInsets .only (
30+ left: 32 ,
31+ ),
32+ child: Text (
33+ "Rescan blockchain" ,
34+ style: STextStyles .desktopH3 (context),
35+ ),
36+ ),
37+ const DesktopDialogCloseButton (),
38+ ],
39+ ),
40+ Padding (
41+ padding: const EdgeInsets .only (
42+ top: 8 ,
43+ left: 32 ,
44+ right: 32 ,
45+ bottom: 32 ,
46+ ),
47+ child: Column (
48+ mainAxisSize: MainAxisSize .min,
49+ children: [
50+ Text (
51+ "Warning! It may take a while. If you exit before completion, you will have to redo the process." ,
52+ style: STextStyles .desktopTextSmall (context),
53+ ),
54+ const SizedBox (
55+ height: 43 ,
56+ ),
57+ Row (
58+ children: [
59+ Expanded (
60+ child: SecondaryButton (
61+ desktopMed: true ,
62+ onPressed: Navigator .of (context).pop,
63+ label: "Cancel" ,
64+ ),
65+ ),
66+ const SizedBox (
67+ width: 16 ,
68+ ),
69+ Expanded (
70+ child: PrimaryButton (
71+ desktopMed: true ,
72+ onPressed: () {
73+ Navigator .of (context).pop ();
74+ onConfirm.call ();
75+ },
76+ label: "Rescan" ,
77+ ),
78+ ),
79+ ],
80+ )
81+ ],
82+ ),
83+ )
84+ ],
3385 ),
34- rightButton: TextButton (
35- style: Theme .of (context)
36- .extension < StackColors > ()!
37- .getPrimaryEnabledButtonColor (context),
38- child: Text (
39- "Rescan" ,
40- style: STextStyles .button (context),
86+ );
87+ } else {
88+ return WillPopScope (
89+ onWillPop: () async {
90+ return true ;
91+ },
92+ child: StackDialog (
93+ title: "Rescan blockchain" ,
94+ message:
95+ "Warning! It may take a while. If you exit before completion, you will have to redo the process." ,
96+ leftButton: TextButton (
97+ style: Theme .of (context)
98+ .extension < StackColors > ()!
99+ .getSecondaryEnabledButtonColor (context),
100+ child: Text (
101+ "Cancel" ,
102+ style: STextStyles .itemSubtitle12 (context),
103+ ),
104+ onPressed: () {
105+ Navigator .of (context).pop ();
106+ },
107+ ),
108+ rightButton: TextButton (
109+ style: Theme .of (context)
110+ .extension < StackColors > ()!
111+ .getPrimaryEnabledButtonColor (context),
112+ child: Text (
113+ "Rescan" ,
114+ style: STextStyles .button (context),
115+ ),
116+ onPressed: () {
117+ Navigator .of (context).pop ();
118+ onConfirm.call ();
119+ },
41120 ),
42- onPressed: () {
43- Navigator .of (context).pop ();
44- onConfirm.call ();
45- },
46121 ),
47- ),
48- );
122+ );
123+ }
49124 }
50125}
0 commit comments