@@ -24,131 +24,140 @@ class CustomUpdateDialog {
2424 canPop: updateType == UpdateType .optional,
2525 child: Dialog (
2626 backgroundColor: Colors .transparent,
27- insetPadding: EdgeInsets .symmetric (horizontal: 28. w, vertical: 24. h),
27+ insetPadding:
28+ EdgeInsets .symmetric (horizontal: 28. w, vertical: 24. h),
2829 child: Container (
2930 width: MediaQuery .of (context).size.width - 32. w,
30- padding: EdgeInsets .only (left: 31. w, right: 31. w, top: 24. h, bottom: 24. h),
3131 decoration: BoxDecoration (
3232 color: Colors .white,
3333 borderRadius: BorderRadius .circular (16. r),
3434 ),
35- child: Column (
36- mainAxisSize: MainAxisSize .min,
37- crossAxisAlignment: CrossAxisAlignment .start,
38- children: [
39- Text (
40- updateType == UpdateType .optional ? 'Update available' : 'Update required' ,
41- style: TextStyle (
42- fontSize: 18. sp,
43- fontWeight: FontWeight .w700,
44- color: Colors .black87,
45- ),
46- ),
47- SizedBox (height: 12. h),
48- if (updateType == UpdateType .optional) ...[
49- Text (
50- description ??
51- 'To get the most out of the app and enjoy the latest improvements, please update to the newest version.' ,
52- style: TextStyle (
53- fontSize: 14. sp,
54- color: Colors .grey,
55- height: 1.4 ,
56- ),
57- ),
58- ] else ...[
59- RichText (
60- text: TextSpan (
35+ child: SingleChildScrollView (
36+ child: Padding (
37+ padding: EdgeInsets .only (
38+ left: 31. w, right: 31. w, top: 24. h, bottom: 24. h),
39+ child: Column (
40+ mainAxisSize: MainAxisSize .min,
41+ crossAxisAlignment: CrossAxisAlignment .start,
42+ children: [
43+ Text (
44+ updateType == UpdateType .optional
45+ ? 'Update available'
46+ : 'Update required' ,
6147 style: TextStyle (
62- fontSize: 16. sp,
63- fontWeight: FontWeight .w400,
64- color: const Color (0x80151920 ),
65- height: 1.4 ,
48+ fontSize: 18. sp,
49+ fontWeight: FontWeight .w700,
50+ color: Colors .black87,
6651 ),
67- text: description ??
68- 'To continue using Defyx, please update to the latest version. This update includes critical improvements and is required for app functionality.' ,
6952 ),
70- ),
71- ],
72- if (updateType == UpdateType .optional && features != null ) ...[
73- SizedBox (height: 16. h),
74- ...features.map ((feature) => Padding (
75- padding: EdgeInsets .only (bottom: 8. h),
76- child: _buildFeatureItem (feature),
77- )),
78- ],
79- SizedBox (height: 20. h),
80- SizedBox (
81- width: double .infinity,
82- height: 44. h,
83- child: ElevatedButton (
84- onPressed: () async {
85- final String url;
86- switch (GlobalVars .appBuildType) {
87- case 'testFlight' :
88- url = GlobalVars .testFlight;
89- break ;
90- case 'appStore' :
91- url = GlobalVars .appStore;
92- break ;
93- case 'googlePlay' :
94- url = GlobalVars .googlePlay;
95- break ;
96- case 'github' :
97- url = GlobalVars .github;
98- break ;
99- default :
100- url = GlobalVars .github;
101- break ;
102- }
103- final uri = Uri .parse (url);
104- if (await canLaunchUrl (uri)) {
105- await launchUrl (uri);
106- }
107- // Implement the update logic here, e.g., open app store or download page
108- // Navigator.of(context).pop(true),
109- },
110- style: ElevatedButton .styleFrom (
111- backgroundColor: const Color (0xFF21AD86 ),
112- foregroundColor: Colors .white,
113- elevation: 0 ,
114- shape: RoundedRectangleBorder (
115- borderRadius: BorderRadius .circular (8. r),
116- ),
117- ),
118- child: Text (
119- 'Update now' ,
120- style: TextStyle (
121- fontSize: 14. sp,
122- fontWeight: FontWeight .w600,
53+ SizedBox (height: 12. h),
54+ if (updateType == UpdateType .optional) ...[
55+ Text (
56+ description ??
57+ 'To get the most out of the app and enjoy the latest improvements, please update to the newest version.' ,
58+ style: TextStyle (
59+ fontSize: 14. sp,
60+ color: Colors .grey,
61+ height: 1.4 ,
62+ ),
12363 ),
124- ),
125- ),
126- ),
127- if (updateType == UpdateType .optional) ...[
128- SizedBox (height: 8. h),
129- SizedBox (
130- width: double .infinity,
131- height: 44. h,
132- child: TextButton (
133- onPressed: () => Navigator .of (context).pop (false ),
134- style: TextButton .styleFrom (
135- backgroundColor: const Color (0xFFF5F5F5 ),
136- foregroundColor: Colors .black54,
137- shape: RoundedRectangleBorder (
138- borderRadius: BorderRadius .circular (8. r),
64+ ] else ...[
65+ RichText (
66+ text: TextSpan (
67+ style: TextStyle (
68+ fontSize: 16. sp,
69+ fontWeight: FontWeight .w400,
70+ color: const Color (0x80151920 ),
71+ height: 1.4 ,
72+ ),
73+ text: description ??
74+ 'To continue using Defyx, please update to the latest version. This update includes critical improvements and is required for app functionality.' ,
13975 ),
14076 ),
141- child: Text (
142- 'Not now' ,
143- style: TextStyle (
144- fontSize: 14. sp,
145- fontWeight: FontWeight .w500,
77+ ],
78+ if (updateType == UpdateType .optional &&
79+ features != null ) ...[
80+ SizedBox (height: 16. h),
81+ ...features.map ((feature) => Padding (
82+ padding: EdgeInsets .only (bottom: 8. h),
83+ child: _buildFeatureItem (feature),
84+ )),
85+ ],
86+ SizedBox (height: 20. h),
87+ SizedBox (
88+ width: double .infinity,
89+ height: 44. h,
90+ child: ElevatedButton (
91+ onPressed: () async {
92+ final String url;
93+ switch (GlobalVars .appBuildType) {
94+ case 'testFlight' :
95+ url = GlobalVars .testFlight;
96+ break ;
97+ case 'appStore' :
98+ url = GlobalVars .appStore;
99+ break ;
100+ case 'googlePlay' :
101+ url = GlobalVars .googlePlay;
102+ break ;
103+ case 'github' :
104+ url = GlobalVars .github;
105+ break ;
106+ default :
107+ url = GlobalVars .github;
108+ break ;
109+ }
110+ final uri = Uri .parse (url);
111+ if (await canLaunchUrl (uri)) {
112+ await launchUrl (uri);
113+ }
114+ // Implement the update logic here, e.g., open app store or download page
115+ // Navigator.of(context).pop(true),
116+ },
117+ style: ElevatedButton .styleFrom (
118+ backgroundColor: const Color (0xFF21AD86 ),
119+ foregroundColor: Colors .white,
120+ elevation: 0 ,
121+ shape: RoundedRectangleBorder (
122+ borderRadius: BorderRadius .circular (8. r),
123+ ),
124+ ),
125+ child: Text (
126+ 'Update now' ,
127+ style: TextStyle (
128+ fontSize: 14. sp,
129+ fontWeight: FontWeight .w600,
130+ ),
146131 ),
147132 ),
148133 ),
149- ),
150- ],
151- ],
134+ if (updateType == UpdateType .optional) ...[
135+ SizedBox (height: 8. h),
136+ SizedBox (
137+ width: double .infinity,
138+ height: 44. h,
139+ child: TextButton (
140+ onPressed: () => Navigator .of (context).pop (false ),
141+ style: TextButton .styleFrom (
142+ backgroundColor: const Color (0xFFF5F5F5 ),
143+ foregroundColor: Colors .black54,
144+ shape: RoundedRectangleBorder (
145+ borderRadius: BorderRadius .circular (8. r),
146+ ),
147+ ),
148+ child: Text (
149+ 'Not now' ,
150+ style: TextStyle (
151+ fontSize: 14. sp,
152+ fontWeight: FontWeight .w500,
153+ ),
154+ ),
155+ ),
156+ ),
157+ ],
158+ ],
159+ ),
160+ ),
152161 ),
153162 ),
154163 ),
@@ -201,13 +210,16 @@ class CustomUpdateDialogAlternative {
201210 ),
202211 content: Container (
203212 width: 343. w,
204- padding: EdgeInsets .only (left: 31. w, right: 31. w, top: 24. h, bottom: 24. h),
213+ padding: EdgeInsets .only (
214+ left: 31. w, right: 31. w, top: 24. h, bottom: 24. h),
205215 child: Column (
206216 mainAxisSize: MainAxisSize .min,
207217 crossAxisAlignment: CrossAxisAlignment .start,
208218 children: [
209219 Text (
210- updateType == UpdateType .optional ? 'Update available' : 'Update required' ,
220+ updateType == UpdateType .optional
221+ ? 'Update available'
222+ : 'Update required' ,
211223 style: TextStyle (
212224 fontSize: 18. sp,
213225 fontWeight: FontWeight .w700,
0 commit comments