CWA-209 | applied scroll to all receive page; reduced height of header tiles and address field; reduced font of address
Oleksandr Sobol committed
May 7, 2020 at 13:07 UTC
0ca1cd7157ade19a41cc9d8081ef4cc39144ae88
2 files changed
+173
-175
lib/src/screens/receive/receive_page.dart
+171
-173
@@ -75,7 +75,7 @@ class ReceiveBodyState extends State<ReceiveBody> {
75
final copyImage = Image.asset('assets/images/copy_content.png');
76
77
final currentColor = PaletteDark.menuList;
78
- final notCurrentColor = Colors.transparent;
78
+ final notCurrentColor = PaletteDark.historyPanel;
79
80
amountController.addListener(() {
81
if (_formKey.currentState.validate()) {
@@ -90,11 +90,10 @@ class ReceiveBodyState extends State<ReceiveBody> {
90
width: MediaQuery.of(context).size.width,
91
color: PaletteDark.mainBackgroundColor,
92
padding: EdgeInsets.only(top: 24),
93
- child: Column(
94
- children: <Widget>[
95
- Flexible(
96
- flex: 2,
97
- child: Observer(builder: (_) {
93
+ child: SingleChildScrollView(
94
+ child: Column(
95
+ children: <Widget>[
96
+ Observer(builder: (_) {
97
return Row(
98
children: <Widget>[
99
Spacer(
@@ -119,193 +118,192 @@ class ReceiveBodyState extends State<ReceiveBody> {
118
],
119
);
120
}),
122
- ),
123
- Padding(
124
- padding: EdgeInsets.all(24),
125
- child: Row(
126
- children: <Widget>[
127
- Expanded(
128
- child: Form(
129
- key: _formKey,
130
- child: BaseTextFormField(
131
- controller: amountController,
132
- keyboardType: TextInputType.numberWithOptions(decimal: true),
133
- inputFormatters: [
134
- BlacklistingTextInputFormatter(
135
- RegExp('[\\-|\\ |\\,]'))
136
- ],
137
- textAlign: TextAlign.center,
138
- hintText: S.of(context).receive_amount,
139
- borderColor: PaletteDark.walletCardText,
140
- validator: (value) {
141
- walletStore.validateAmount(value);
142
- return walletStore.errorMessage;
143
- },
144
- autovalidate: true,
145
- )
146
- )
147
- )
148
- ],
121
+ Padding(
122
+ padding: EdgeInsets.all(24),
123
+ child: Row(
124
+ children: <Widget>[
125
+ Expanded(
126
+ child: Form(
127
+ key: _formKey,
128
+ child: BaseTextFormField(
129
+ controller: amountController,
130
+ keyboardType: TextInputType.numberWithOptions(decimal: true),
131
+ inputFormatters: [
132
+ BlacklistingTextInputFormatter(
133
+ RegExp('[\\-|\\ |\\,]'))
134
+ ],
135
+ textAlign: TextAlign.center,
136
+ hintText: S.of(context).receive_amount,
137
+ borderColor: PaletteDark.walletCardText,
138
+ validator: (value) {
139
+ walletStore.validateAmount(value);
140
+ return walletStore.errorMessage;
141
+ },
142
+ autovalidate: true,
143
+ )
144
+ )
145
+ )
146
+ ],
147
+ ),
148
),
150
- ),
151
- Padding(
152
- padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
153
- child: Observer(
154
- builder: (_) => GestureDetector(
155
- onTap: () {
156
- Clipboard.setData(ClipboardData(
157
- text: walletStore.subaddress.address));
158
- Scaffold.of(context).showSnackBar(SnackBar(
159
- content: Text(
160
- S.of(context).copied_to_clipboard,
161
- style: TextStyle(color: Colors.white),
149
+ Padding(
150
+ padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
151
+ child: Observer(
152
+ builder: (_) => GestureDetector(
153
+ onTap: () {
154
+ Clipboard.setData(ClipboardData(
155
+ text: walletStore.subaddress.address));
156
+ Scaffold.of(context).showSnackBar(SnackBar(
157
+ content: Text(
158
+ S.of(context).copied_to_clipboard,
159
+ style: TextStyle(color: Colors.white),
160
+ ),
161
+ backgroundColor: Colors.green,
162
+ duration: Duration(milliseconds: 500),
163
+ ));
164
+ },
165
+ child: Container(
166
+ height: 48,
167
+ padding: EdgeInsets.only(left: 24, right: 24),
168
+ decoration: BoxDecoration(
169
+ borderRadius: BorderRadius.all(Radius.circular(27)),
170
+ color: PaletteDark.walletCardSubAddressField
171
),
163
- backgroundColor: Colors.green,
164
- duration: Duration(milliseconds: 500),
165
- ));
166
- },
167
- child: Container(
168
- height: 54,
169
- padding: EdgeInsets.only(left: 24, right: 24),
170
- decoration: BoxDecoration(
171
- borderRadius: BorderRadius.all(Radius.circular(27)),
172
- color: PaletteDark.walletCardSubAddressField
173
- ),
174
- child: Row(
175
- mainAxisSize: MainAxisSize.max,
176
- children: <Widget>[
177
- Expanded(
178
- child: Text(
179
- walletStore.subaddress.address,
180
- maxLines: 1,
181
- overflow: TextOverflow.ellipsis,
182
- style: TextStyle(
183
- fontSize: 18,
184
- fontWeight: FontWeight.w600,
185
- color: Colors.white
172
+ child: Row(
173
+ mainAxisSize: MainAxisSize.max,
174
+ children: <Widget>[
175
+ Expanded(
176
+ child: Text(
177
+ walletStore.subaddress.address,
178
+ maxLines: 1,
179
+ overflow: TextOverflow.ellipsis,
180
+ style: TextStyle(
181
+ fontSize: 14,
182
+ fontWeight: FontWeight.w600,
183
+ color: Colors.white
184
+ ),
185
),
186
),
188
- ),
189
- Padding(
190
- padding: EdgeInsets.only(left: 12),
191
- child: copyImage,
192
- )
193
- ],
187
+ Padding(
188
+ padding: EdgeInsets.only(left: 12),
189
+ child: copyImage,
190
+ )
191
+ ],
192
+ ),
193
),
195
- ),
196
- )
194
+ )
195
+ ),
196
),
198
- ),
199
- Flexible(
200
- flex: 3,
201
- child: ClipRRect(
197
+ Container(
198
+ decoration: BoxDecoration(
199
borderRadius: BorderRadius.only(
200
topLeft: Radius.circular(24),
201
topRight: Radius.circular(24),
202
),
206
- child: Container(
207
- color: PaletteDark.historyPanel,
208
- child: Observer(
209
- builder: (_) => ListView.separated(
210
- separatorBuilder: (context, index) => Divider(
211
- height: 1,
212
- color: PaletteDark.menuList,
213
- ),
214
- itemCount: subaddressListStore.subaddresses.length + 2,
215
- itemBuilder: (context, index) {
203
+ color: PaletteDark.historyPanel,
204
+ ),
205
+ child: Observer(
206
+ builder: (_) => ListView.separated(
207
+ separatorBuilder: (context, index) => Divider(
208
+ height: 1,
209
+ color: PaletteDark.menuList,
210
+ ),
211
+ shrinkWrap: true,
212
+ physics: NeverScrollableScrollPhysics(),
213
+ itemCount: subaddressListStore.subaddresses.length + 2,
214
+ itemBuilder: (context, index) {
215
217
- if (index == 0) {
218
- return HeaderTile(
219
- onTap: () async {
220
- await showDialog<void>(
221
- context: context,
222
- builder: (BuildContext context) {
223
- return AccountListPage(accountListStore: accountListStore);
224
- }
225
- );
226
- },
227
- title: walletStore.account.label,
228
- icon: Icon(
229
- Icons.arrow_forward_ios,
230
- size: 14,
231
- color: Colors.white,
232
- )
233
- );
234
- }
216
+ if (index == 0) {
217
+ return HeaderTile(
218
+ onTap: () async {
219
+ await showDialog<void>(
220
+ context: context,
221
+ builder: (BuildContext context) {
222
+ return AccountListPage(accountListStore: accountListStore);
223
+ }
224
+ );
225
+ },
226
+ title: walletStore.account.label,
227
+ icon: Icon(
228
+ Icons.arrow_forward_ios,
229
+ size: 14,
230
+ color: Colors.white,
231
+ )
232
+ );
233
+ }
234
236
- if (index == 1) {
237
- return HeaderTile(
238
- onTap: () => Navigator.of(context)
239
- .pushNamed(Routes.newSubaddress),
240
- title: S.of(context).subaddresses,
241
- icon: Icon(
242
- Icons.add,
243
- size: 20,
244
- color: Colors.white,
245
- )
246
- );
247
- }
235
+ if (index == 1) {
236
+ return HeaderTile(
237
+ onTap: () => Navigator.of(context)
238
+ .pushNamed(Routes.newSubaddress),
239
+ title: S.of(context).subaddresses,
240
+ icon: Icon(
241
+ Icons.add,
242
+ size: 20,
243
+ color: Colors.white,
244
+ )
245
+ );
246
+ }
247
249
- index -= 2;
248
+ index -= 2;
249
251
- return Observer(
252
- builder: (_) {
253
- final subaddress = subaddressListStore.subaddresses[index];
254
- final isCurrent =
255
- walletStore.subaddress.address == subaddress.address;
250
+ return Observer(
251
+ builder: (_) {
252
+ final subaddress = subaddressListStore.subaddresses[index];
253
+ final isCurrent =
254
+ walletStore.subaddress.address == subaddress.address;
255
257
- final label = subaddress.label;
258
- final address = subaddress.address;
256
+ final label = subaddress.label;
257
+ final address = subaddress.address;
258
260
- return InkWell(
261
- onTap: () => walletStore.setSubaddress(subaddress),
262
- child: Container(
263
- color: isCurrent ? currentColor : notCurrentColor,
264
- padding: EdgeInsets.only(
265
- left: 24,
266
- right: 24,
267
- top: 32,
268
- bottom: 32
269
- ),
270
- child: Column(
271
- mainAxisAlignment: MainAxisAlignment.start,
272
- crossAxisAlignment: CrossAxisAlignment.start,
273
- children: <Widget>[
274
- label.isNotEmpty
259
+ return InkWell(
260
+ onTap: () => walletStore.setSubaddress(subaddress),
261
+ child: Container(
262
+ color: isCurrent ? currentColor : notCurrentColor,
263
+ padding: EdgeInsets.only(
264
+ left: 24,
265
+ right: 24,
266
+ top: 32,
267
+ bottom: 32
268
+ ),
269
+ child: Column(
270
+ mainAxisAlignment: MainAxisAlignment.start,
271
+ crossAxisAlignment: CrossAxisAlignment.start,
272
+ children: <Widget>[
273
+ label.isNotEmpty
274
? Text(
276
- label,
277
- style: TextStyle(
278
- fontSize: 14,
279
- color: PaletteDark.walletCardText
280
- ),
281
- )
275
+ label,
276
+ style: TextStyle(
277
+ fontSize: 14,
278
+ color: PaletteDark.walletCardText
279
+ ),
280
+ )
281
: Offstage(),
283
- Padding(
284
- padding: label.isNotEmpty
282
+ Padding(
283
+ padding: label.isNotEmpty
284
? EdgeInsets.only(top: 10)
285
: EdgeInsets.only(top: 0),
287
- child: Text(
288
- address,
289
- style: TextStyle(
290
- fontSize: 16,
291
- fontWeight: FontWeight.w600,
292
- color: Colors.white
293
- ),
294
- ),
295
- )
296
- ]),
297
- ),
298
- );
299
- }
300
- );
301
- }
302
- )
303
- ),
304
- ),
305
- )
306
- )
307
- ],
308
- ),
286
+ child: Text(
287
+ address,
288
+ style: TextStyle(
289
+ fontSize: 16,
290
+ fontWeight: FontWeight.w600,
291
+ color: Colors.white
292
+ ),
293
+ ),
294
+ )
295
+ ]),
296
+ ),
297
+ );
298
+ }
299
+ );
300
+ }
301
+ )
302
+ ),
303
+ ),
304
+ ],
305
+ ),
306
+ )
307
);
308
}
309
}
\ No newline at end of file
lib/src/screens/receive/widgets/header_tile.dart
+2
-2
@@ -20,8 +20,8 @@ class HeaderTile extends StatelessWidget {
20
padding: EdgeInsets.only(
21
left: 24,
22
right: 24,
23
- top: 32,
24
- bottom: 32
23
+ top: 24,
24
+ bottom: 24
25
),
26
color: Colors.transparent,
27
child: Row(