Fixes.
M committed
Oct 29, 2020 at 20:10 UTC
882f13011c70247d1686d229dbba486c2a4d5767
4 files changed
+260
-257
lib/src/screens/dashboard/widgets/filter_widget.dart
+1
-1
@@ -97,7 +97,7 @@ class FilterWidget extends StatelessWidget {
97
final item = section[index2];
98
final content = item.onChanged != null
99
? CheckboxWidget(
100
- value: item.value,
100
+ value: item.value(),
101
caption: item.caption,
102
onChanged: item.onChanged
103
)
lib/src/screens/disclaimer/disclaimer_page.dart
+249
-246
@@ -62,266 +62,269 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
62
63
@override
64
Widget build(BuildContext context) {
65
- return Container(
66
- color: Theme.of(context).backgroundColor,
67
- child: Column(
68
- children: <Widget>[
69
- SizedBox(height: 10.0),
70
- Expanded(
71
- child: Stack(
65
+ return WillPopScope(
66
+ onWillPop: () async => false,
67
+ child: Container(
68
+ color: Theme.of(context).backgroundColor,
69
+ child: Column(
70
children: <Widget>[
73
- SingleChildScrollView(
74
- padding: EdgeInsets.only(left: 24.0, right: 24.0),
75
- child: Column(
76
- children: <Widget>[
77
- Row(
78
- children: <Widget>[
79
- Expanded(
80
- child: Text(
81
- 'Terms and conditions',
82
- textAlign: TextAlign.center,
83
- style: TextStyle(
84
- fontSize: 20.0,
85
- fontWeight: FontWeight.bold,
86
- color: Theme.of(context)
87
- .primaryTextTheme
88
- .title
89
- .color),
90
- ),
91
- )
92
- ],
93
- ),
94
- SizedBox(
95
- height: 20.0,
96
- ),
97
- Row(
98
- children: <Widget>[
99
- Expanded(
100
- child: Text(
101
- 'Legal Disclaimer\nAnd\nTerms of Use',
102
- textAlign: TextAlign.center,
103
- style: TextStyle(
104
- fontSize: 12.0,
105
- fontWeight: FontWeight.bold,
106
- color: Theme.of(context)
107
- .primaryTextTheme
108
- .title
109
- .color),
110
- ),
111
- )
112
- ],
113
- ),
114
- SizedBox(
115
- height: 16.0,
116
- ),
117
- Row(
71
+ SizedBox(height: 10.0),
72
+ Expanded(
73
+ child: Stack(
74
+ children: <Widget>[
75
+ SingleChildScrollView(
76
+ padding: EdgeInsets.only(left: 24.0, right: 24.0),
77
+ child: Column(
78
children: <Widget>[
119
- Expanded(
120
- child: Text(
121
- _fileText,
122
- style: TextStyle(
123
- fontSize: 12.0,
124
- fontWeight: FontWeight.normal,
125
- color: Theme.of(context)
126
- .primaryTextTheme
127
- .title
128
- .color),
129
- ))
130
- ],
131
- ),
132
- SizedBox(
133
- height: 16.0,
134
- ),
135
- Row(
136
- mainAxisAlignment: MainAxisAlignment.start,
137
- children: <Widget>[
138
- Expanded(
139
- child: Text(
140
- 'Other Terms and Conditions',
141
- textAlign: TextAlign.left,
142
- style: TextStyle(
143
- fontSize: 14.0,
144
- fontWeight: FontWeight.bold,
145
- color: Theme.of(context)
146
- .primaryTextTheme
147
- .title
148
- .color),
149
- ),
150
- )
151
- ],
152
- ),
153
- SizedBox(
154
- height: 16.0,
155
- ),
156
- Row(
157
- mainAxisAlignment: MainAxisAlignment.start,
158
- children: <Widget>[
159
- Expanded(
160
- child: GestureDetector(
161
- onTap: () => launchUrl(xmrtoUrl),
162
- child: Text(
163
- xmrtoUrl,
164
- textAlign: TextAlign.left,
165
- style: TextStyle(
166
- color: Palette.blueCraiola,
167
- fontSize: 14.0,
168
- fontWeight: FontWeight.normal,
169
- decoration: TextDecoration.underline),
170
- ),
171
- ))
172
- ],
173
- ),
174
- SizedBox(
175
- height: 16.0,
176
- ),
177
- Row(
178
- mainAxisAlignment: MainAxisAlignment.start,
179
- children: <Widget>[
180
- Expanded(
181
- child: GestureDetector(
182
- onTap: () => launchUrl(changenowUrl),
183
- child: Text(
184
- changenowUrl,
185
- textAlign: TextAlign.left,
186
- style: TextStyle(
187
- color: Palette.blueCraiola,
188
- fontSize: 14.0,
189
- fontWeight: FontWeight.normal,
190
- decoration: TextDecoration.underline),
191
- ),
192
- ))
193
- ],
194
- ),
195
- SizedBox(
196
- height: 16.0,
197
- ),
198
- Row(
199
- mainAxisAlignment: MainAxisAlignment.start,
200
- children: <Widget>[
201
- Expanded(
202
- child: GestureDetector(
203
- onTap: () => launchUrl(morphUrl),
204
- child: Text(
205
- morphUrl,
206
- textAlign: TextAlign.left,
207
- style: TextStyle(
208
- color: Palette.blueCraiola,
209
- fontSize: 14.0,
210
- fontWeight: FontWeight.normal,
211
- decoration: TextDecoration.underline),
212
- ),
213
- ))
214
- ],
215
- ),
216
- SizedBox(
217
- height: 16.0,
218
- )
219
- ],
220
- ),
221
- ),
222
- Container(
223
- alignment: Alignment.bottomCenter,
224
- child: Container(
225
- height: 12.0,
226
- child: ClipRect(
227
- child: BackdropFilter(
228
- filter: ImageFilter.blur(sigmaX: 0.7, sigmaY: 0.7),
229
- child: Container(
230
- decoration: BoxDecoration(
231
- gradient: LinearGradient(
232
- colors: [
233
- Theme.of(context)
234
- .backgroundColor
235
- .withOpacity(0.0),
236
- Theme.of(context).backgroundColor,
237
- ],
238
- begin: FractionalOffset.topCenter,
239
- end: FractionalOffset.bottomCenter,
240
- ),
79
+ Row(
80
+ children: <Widget>[
81
+ Expanded(
82
+ child: Text(
83
+ 'Terms and conditions',
84
+ textAlign: TextAlign.center,
85
+ style: TextStyle(
86
+ fontSize: 20.0,
87
+ fontWeight: FontWeight.bold,
88
+ color: Theme.of(context)
89
+ .primaryTextTheme
90
+ .title
91
+ .color),
92
+ ),
93
+ )
94
+ ],
95
),
242
- ),
243
- ),
244
- ),
245
- ),
246
- )
247
- ],
248
- )),
249
- if (!widget.isReadOnly) ...[
250
- Row(
251
- children: <Widget>[
252
- Expanded(
253
- child: Container(
254
- padding: EdgeInsets.only(
255
- left: 24.0, top: 10.0, right: 24.0, bottom: 10.0),
256
- child: InkWell(
257
- onTap: () {
258
- setState(() {
259
- _checked = !_checked;
260
- });
261
- },
262
- child: Row(
263
- mainAxisAlignment: MainAxisAlignment.start,
96
+ SizedBox(
97
+ height: 20.0,
98
+ ),
99
+ Row(
100
children: <Widget>[
265
- Container(
266
- height: 24.0,
267
- width: 24.0,
268
- margin: EdgeInsets.only(
269
- right: 10.0,
101
+ Expanded(
102
+ child: Text(
103
+ 'Legal Disclaimer\nAnd\nTerms of Use',
104
+ textAlign: TextAlign.center,
105
+ style: TextStyle(
106
+ fontSize: 12.0,
107
+ fontWeight: FontWeight.bold,
108
+ color: Theme.of(context)
109
+ .primaryTextTheme
110
+ .title
111
+ .color),
112
),
271
- decoration: BoxDecoration(
272
- border: Border.all(
273
- color: Theme.of(context)
274
- .primaryTextTheme
275
- .caption
276
- .color,
277
- width: 1.0),
278
- borderRadius:
279
- BorderRadius.all(Radius.circular(8.0)),
280
- color: Theme.of(context).backgroundColor),
281
- child: _checked
282
- ? Icon(
283
- Icons.check,
284
- color: Colors.blue,
285
- size: 20.0,
286
- )
287
- : null,
288
- ),
289
- Text(
290
- 'I agree to Terms of Use',
113
+ )
114
+ ],
115
+ ),
116
+ SizedBox(
117
+ height: 16.0,
118
+ ),
119
+ Row(
120
+ children: <Widget>[
121
+ Expanded(
122
+ child: Text(
123
+ _fileText,
124
style: TextStyle(
292
- fontWeight: FontWeight.bold,
293
- fontSize: 14.0,
125
+ fontSize: 12.0,
126
+ fontWeight: FontWeight.normal,
127
color: Theme.of(context)
128
.primaryTextTheme
129
.title
130
.color),
131
+ ))
132
+ ],
133
+ ),
134
+ SizedBox(
135
+ height: 16.0,
136
+ ),
137
+ Row(
138
+ mainAxisAlignment: MainAxisAlignment.start,
139
+ children: <Widget>[
140
+ Expanded(
141
+ child: Text(
142
+ 'Other Terms and Conditions',
143
+ textAlign: TextAlign.left,
144
+ style: TextStyle(
145
+ fontSize: 14.0,
146
+ fontWeight: FontWeight.bold,
147
+ color: Theme.of(context)
148
+ .primaryTextTheme
149
+ .title
150
+ .color),
151
+ ),
152
)
153
],
154
),
301
- )),
155
+ SizedBox(
156
+ height: 16.0,
157
+ ),
158
+ Row(
159
+ mainAxisAlignment: MainAxisAlignment.start,
160
+ children: <Widget>[
161
+ Expanded(
162
+ child: GestureDetector(
163
+ onTap: () => launchUrl(xmrtoUrl),
164
+ child: Text(
165
+ xmrtoUrl,
166
+ textAlign: TextAlign.left,
167
+ style: TextStyle(
168
+ color: Palette.blueCraiola,
169
+ fontSize: 14.0,
170
+ fontWeight: FontWeight.normal,
171
+ decoration: TextDecoration.underline),
172
+ ),
173
+ ))
174
+ ],
175
+ ),
176
+ SizedBox(
177
+ height: 16.0,
178
+ ),
179
+ Row(
180
+ mainAxisAlignment: MainAxisAlignment.start,
181
+ children: <Widget>[
182
+ Expanded(
183
+ child: GestureDetector(
184
+ onTap: () => launchUrl(changenowUrl),
185
+ child: Text(
186
+ changenowUrl,
187
+ textAlign: TextAlign.left,
188
+ style: TextStyle(
189
+ color: Palette.blueCraiola,
190
+ fontSize: 14.0,
191
+ fontWeight: FontWeight.normal,
192
+ decoration: TextDecoration.underline),
193
+ ),
194
+ ))
195
+ ],
196
+ ),
197
+ SizedBox(
198
+ height: 16.0,
199
+ ),
200
+ Row(
201
+ mainAxisAlignment: MainAxisAlignment.start,
202
+ children: <Widget>[
203
+ Expanded(
204
+ child: GestureDetector(
205
+ onTap: () => launchUrl(morphUrl),
206
+ child: Text(
207
+ morphUrl,
208
+ textAlign: TextAlign.left,
209
+ style: TextStyle(
210
+ color: Palette.blueCraiola,
211
+ fontSize: 14.0,
212
+ fontWeight: FontWeight.normal,
213
+ decoration: TextDecoration.underline),
214
+ ),
215
+ ))
216
+ ],
217
+ ),
218
+ SizedBox(
219
+ height: 16.0,
220
+ )
221
+ ],
222
+ ),
223
+ ),
224
+ Container(
225
+ alignment: Alignment.bottomCenter,
226
+ child: Container(
227
+ height: 12.0,
228
+ child: ClipRect(
229
+ child: BackdropFilter(
230
+ filter: ImageFilter.blur(sigmaX: 0.7, sigmaY: 0.7),
231
+ child: Container(
232
+ decoration: BoxDecoration(
233
+ gradient: LinearGradient(
234
+ colors: [
235
+ Theme.of(context)
236
+ .backgroundColor
237
+ .withOpacity(0.0),
238
+ Theme.of(context).backgroundColor,
239
+ ],
240
+ begin: FractionalOffset.topCenter,
241
+ end: FractionalOffset.bottomCenter,
242
+ ),
243
+ ),
244
+ ),
245
+ ),
246
+ ),
247
+ ),
248
+ )
249
+ ],
250
+ )),
251
+ if (!widget.isReadOnly) ...[
252
+ Row(
253
+ children: <Widget>[
254
+ Expanded(
255
+ child: Container(
256
+ padding: EdgeInsets.only(
257
+ left: 24.0, top: 10.0, right: 24.0, bottom: 10.0),
258
+ child: InkWell(
259
+ onTap: () {
260
+ setState(() {
261
+ _checked = !_checked;
262
+ });
263
+ },
264
+ child: Row(
265
+ mainAxisAlignment: MainAxisAlignment.start,
266
+ children: <Widget>[
267
+ Container(
268
+ height: 24.0,
269
+ width: 24.0,
270
+ margin: EdgeInsets.only(
271
+ right: 10.0,
272
+ ),
273
+ decoration: BoxDecoration(
274
+ border: Border.all(
275
+ color: Theme.of(context)
276
+ .primaryTextTheme
277
+ .caption
278
+ .color,
279
+ width: 1.0),
280
+ borderRadius: BorderRadius.all(
281
+ Radius.circular(8.0)),
282
+ color: Theme.of(context).backgroundColor),
283
+ child: _checked
284
+ ? Icon(
285
+ Icons.check,
286
+ color: Colors.blue,
287
+ size: 20.0,
288
+ )
289
+ : null,
290
+ ),
291
+ Text(
292
+ 'I agree to Terms of Use',
293
+ style: TextStyle(
294
+ fontWeight: FontWeight.bold,
295
+ fontSize: 14.0,
296
+ color: Theme.of(context)
297
+ .primaryTextTheme
298
+ .title
299
+ .color),
300
+ )
301
+ ],
302
+ ),
303
+ )),
304
+ ),
305
+ ],
306
+ ),
307
+ Container(
308
+ padding:
309
+ EdgeInsets.only(left: 24.0, right: 24.0, bottom: 24.0),
310
+ child: PrimaryButton(
311
+ onPressed: _checked
312
+ ? () => Navigator.of(context)
313
+ .popAndPushNamed(Routes.welcome)
314
+ : null,
315
+ text: 'Accept',
316
+ color: Theme.of(context)
317
+ .accentTextTheme
318
+ .subtitle
319
+ .decorationColor,
320
+ textColor: Theme.of(context)
321
+ .accentTextTheme
322
+ .headline
323
+ .decorationColor),
324
),
325
],
304
- ),
305
- Container(
306
- padding: EdgeInsets.only(left: 24.0, right: 24.0, bottom: 24.0),
307
- child: PrimaryButton(
308
- onPressed: _checked
309
- ? () =>
310
- Navigator.of(context).popAndPushNamed(Routes.welcome)
311
- : null,
312
- text: 'Accept',
313
- color: Theme.of(context)
314
- .accentTextTheme
315
- .subtitle
316
- .decorationColor,
317
- textColor: Theme.of(context)
318
- .accentTextTheme
319
- .headline
320
- .decorationColor),
321
- ),
322
- ],
323
- ],
324
- ),
325
- );
326
+ ],
327
+ ),
328
+ ));
329
}
330
}
lib/view_model/dashboard/dashboard_view_model.dart
+9
-9
@@ -39,31 +39,31 @@ abstract class DashboardViewModelBase with Store {
39
filterItems = {
40
S.current.transactions: [
41
FilterItem(
42
- value: transactionFilterStore.displayIncoming,
42
+ value: () => transactionFilterStore.displayIncoming,
43
caption: S.current.incoming,
44
onChanged: (value) => transactionFilterStore.toggleIncoming()),
45
FilterItem(
46
- value: transactionFilterStore.displayOutgoing,
46
+ value: () => transactionFilterStore.displayOutgoing,
47
caption: S.current.outgoing,
48
onChanged: (value) => transactionFilterStore.toggleOutgoing()),
49
- FilterItem(
50
- value: false,
51
- caption: S.current.transactions_by_date,
52
- onChanged: null),
49
+ // FilterItem(
50
+ // value: () => false,
51
+ // caption: S.current.transactions_by_date,
52
+ // onChanged: null),
53
],
54
S.current.trades: [
55
FilterItem(
56
- value: tradeFilterStore.displayXMRTO,
56
+ value: () => tradeFilterStore.displayXMRTO,
57
caption: 'XMR.TO',
58
onChanged: (value) => tradeFilterStore
59
.toggleDisplayExchange(ExchangeProviderDescription.xmrto)),
60
FilterItem(
61
- value: tradeFilterStore.displayChangeNow,
61
+ value: () => tradeFilterStore.displayChangeNow,
62
caption: 'Change.NOW',
63
onChanged: (value) => tradeFilterStore
64
.toggleDisplayExchange(ExchangeProviderDescription.changeNow)),
65
FilterItem(
66
- value: tradeFilterStore.displayMorphToken,
66
+ value: () => tradeFilterStore.displayMorphToken,
67
caption: 'MorphToken',
68
onChanged: (value) => tradeFilterStore
69
.toggleDisplayExchange(ExchangeProviderDescription.morphToken)),
lib/view_model/dashboard/filter_item.dart
+1
-1
@@ -1,7 +1,7 @@
1
class FilterItem {
2
FilterItem({this.value, this.caption, this.onChanged});
3
4
- bool value;
4
+ bool Function() value;
5
String caption;
6
Function(bool) onChanged;
7
}
\ No newline at end of file