CAKE-29 | applied new design to node list, node create or edit, contact list and contact pages
Oleksandr Sobol committed
Aug 31, 2020 at 19:44 UTC
c3dc2be8d4b9f3f0575e478a8c1fb91a1a3049d4
10 files changed
+200
-268
lib/src/screens/contact/contact_list_page.dart
+65
-69
@@ -9,6 +9,7 @@ import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
9
import 'package:cake_wallet/src/screens/base_page.dart';
10
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
11
import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart';
12
+import 'package:cake_wallet/src/widgets/standard_list.dart';
13
14
class ContactListPage extends BasePage {
15
ContactListPage(this.contactListViewModel, {this.isEditable = true});
@@ -30,7 +31,7 @@ class ContactListPage extends BasePage {
31
height: 32.0,
32
decoration: BoxDecoration(
33
shape: BoxShape.circle,
33
- color: Theme.of(context).accentTextTheme.title.backgroundColor),
34
+ color: Theme.of(context).accentTextTheme.caption.color),
35
child: Stack(
36
alignment: Alignment.center,
37
children: <Widget>[
@@ -54,30 +55,30 @@ class ContactListPage extends BasePage {
55
56
@override
57
Widget body(BuildContext context) {
58
+ final shortDivider = Container(
59
+ height: 1,
60
+ padding: EdgeInsets.only(left: 24),
61
+ color: Theme.of(context).backgroundColor,
62
+ child: Container(
63
+ height: 1,
64
+ color: Theme.of(context).primaryTextTheme.title.backgroundColor,
65
+ ),
66
+ );
67
+
68
return Container(
58
- color: Theme.of(context).backgroundColor,
69
padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
70
child: Observer(
71
builder: (_) {
72
return contactListViewModel.contacts.isNotEmpty
63
- ? ListView.separated(
64
- separatorBuilder: (_, __) => Container(
65
- height: 1,
66
- padding: EdgeInsets.only(left: 24),
67
- color: Theme.of(context)
68
- .accentTextTheme
69
- .title
70
- .backgroundColor,
71
- child: Container(
72
- height: 1,
73
- color: Theme.of(context).dividerColor,
74
- ),
75
- ),
76
- itemCount: contactListViewModel.contacts.length,
77
- itemBuilder: (BuildContext context, int index) {
78
- final contact = contactListViewModel.contacts[index];
79
- final image = _getCurrencyImage(contact.type);
80
- final content = GestureDetector(
73
+ ? SectionStandardList(
74
+ sectionCount: 1,
75
+ context: context,
76
+ itemCounter: (int sectionIndex) => contactListViewModel.contacts.length,
77
+ itemBuilder: (_, sectionIndex, index) {
78
+ final contact = contactListViewModel.contacts[index];
79
+ final image = _getCurrencyImage(contact.type);
80
+ final content = Builder(
81
+ builder: (context) => GestureDetector(
82
onTap: () async {
83
if (!isEditable) {
84
Navigator.of(context).pop(contact);
@@ -106,10 +107,6 @@ class ContactListPage extends BasePage {
107
children: <Widget>[
108
Container(
109
width: double.infinity,
109
- color: Theme.of(context)
110
- .accentTextTheme
111
- .title
112
- .backgroundColor,
110
child: Padding(
111
padding: const EdgeInsets.only(
112
left: 24, top: 16, bottom: 16, right: 24),
@@ -117,7 +114,7 @@ class ContactListPage extends BasePage {
114
mainAxisSize: MainAxisSize.min,
115
mainAxisAlignment: MainAxisAlignment.start,
116
crossAxisAlignment:
120
- CrossAxisAlignment.center,
117
+ CrossAxisAlignment.center,
118
children: <Widget>[
119
image ?? Offstage(),
120
Padding(
@@ -128,6 +125,7 @@ class ContactListPage extends BasePage {
125
contact.name,
126
style: TextStyle(
127
fontSize: 14,
128
+ fontWeight: FontWeight.normal,
129
color: Theme.of(context)
130
.primaryTextTheme
131
.title
@@ -139,57 +137,55 @@ class ContactListPage extends BasePage {
137
),
138
],
139
),
142
- );
140
+ )
141
+ );
142
144
- return !isEditable
145
- ? content
146
- : Slidable(
147
- key: Key('${contact.key}'),
148
- actionPane: SlidableDrawerActionPane(),
149
- child: content,
150
- secondaryActions: <Widget>[
151
- IconSlideAction(
152
- caption: S.of(context).edit,
153
- color: Colors.blue,
154
- icon: Icons.edit,
155
- onTap: () async => await Navigator.of(context)
156
- .pushNamed(Routes.addressBookAddContact,
157
- arguments: contact),
158
- ),
159
- IconSlideAction(
160
- caption: S.of(context).delete,
161
- color: Colors.red,
162
- icon: CupertinoIcons.delete,
163
- onTap: () async {
164
- final isDelete =
165
- await showAlertDialog(context) ?? false;
143
+ return !isEditable
144
+ ? content
145
+ : Slidable(
146
+ key: Key('${contact.key}'),
147
+ actionPane: SlidableDrawerActionPane(),
148
+ child: content,
149
+ secondaryActions: <Widget>[
150
+ IconSlideAction(
151
+ caption: S.of(context).edit,
152
+ color: Colors.blue,
153
+ icon: Icons.edit,
154
+ onTap: () async => await Navigator.of(context)
155
+ .pushNamed(Routes.addressBookAddContact,
156
+ arguments: contact),
157
+ ),
158
+ IconSlideAction(
159
+ caption: S.of(context).delete,
160
+ color: Colors.red,
161
+ icon: CupertinoIcons.delete,
162
+ onTap: () async {
163
+ final isDelete =
164
+ await showAlertDialog(context) ?? false;
165
167
- if (isDelete) {
168
- await contactListViewModel
169
- .delete(contact);
170
- }
171
- },
172
- ),
173
- ],
174
- dismissal: SlidableDismissal(
175
- child: SlidableDrawerDismissal(),
176
- onDismissed: (actionType) async =>
177
- await contactListViewModel.delete(contact),
178
- onWillDismiss: (actionType) async =>
179
- showAlertDialog(context),
180
- ),
181
- );
182
- })
166
+ if (isDelete) {
167
+ await contactListViewModel
168
+ .delete(contact);
169
+ }
170
+ },
171
+ ),
172
+ ],
173
+ dismissal: SlidableDismissal(
174
+ child: SlidableDrawerDismissal(),
175
+ onDismissed: (actionType) async =>
176
+ await contactListViewModel.delete(contact),
177
+ onWillDismiss: (actionType) async =>
178
+ showAlertDialog(context),
179
+ ),
180
+ );
181
+ },
182
+ )
183
: Center(
184
child: Text(
185
S.of(context).placeholder_contacts,
186
textAlign: TextAlign.center,
187
style: TextStyle(
188
- color: Theme.of(context)
189
- .primaryTextTheme
190
- .caption
191
- .color
192
- .withOpacity(0.5),
188
+ color: Colors.grey,
189
fontSize: 14),
190
),
191
);
lib/src/screens/contact/contact_page.dart
+76
-71
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/palette.dart';
2
import 'package:flutter/material.dart';
3
import 'package:flutter/cupertino.dart';
4
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -30,7 +31,7 @@ class ContactPage extends BasePage {
31
.addListener(() => contactViewModel.address = _addressController.text);
32
33
autorun((_) =>
33
- _currencyTypeController.text = contactViewModel.currency.toString());
34
+ _currencyTypeController.text = contactViewModel.currency?.toString()??'');
35
}
36
37
@override
@@ -45,7 +46,7 @@ class ContactPage extends BasePage {
46
@override
47
Widget body(BuildContext context) {
48
final downArrow = Image.asset('assets/images/arrow_bottom_purple_icon.png',
48
- color: Theme.of(context).dividerColor, height: 8);
49
+ color: Theme.of(context).primaryTextTheme.overline.color, height: 8);
50
51
reaction((_) => contactViewModel.state, (ContactViewModelState state) {
52
if (state is ContactCreationFailure) {
@@ -57,79 +58,83 @@ class ContactPage extends BasePage {
58
}
59
});
60
60
- return Container(
61
- color: Theme.of(context).backgroundColor,
62
- child: ScrollableWithBottomSection(
63
- contentPadding: EdgeInsets.all(24),
64
- content: Form(
65
- key: _formKey,
66
- child: Column(
67
- mainAxisSize: MainAxisSize.min,
68
- children: <Widget>[
69
- BaseTextFormField(
70
- controller: _nameController,
71
- hintText: S.of(context).contact_name,
72
- validator: ContactNameValidator()),
73
- Padding(
74
- padding: EdgeInsets.only(top: 20),
75
- child: Container(
76
- child: InkWell(
77
- onTap: () => _presentCurrencyPicker(context),
78
- child: IgnorePointer(
79
- child: BaseTextFormField(
80
- controller: _currencyTypeController,
81
- hintText: S.of(context).settings_currency,
82
- suffixIcon: Row(
83
- mainAxisSize: MainAxisSize.min,
84
- mainAxisAlignment: MainAxisAlignment.end,
85
- children: <Widget>[downArrow],
86
- ),
87
- )),
88
- ),
61
+ return ScrollableWithBottomSection(
62
+ contentPadding: EdgeInsets.all(24),
63
+ content: Form(
64
+ key: _formKey,
65
+ child: Column(
66
+ mainAxisSize: MainAxisSize.min,
67
+ children: <Widget>[
68
+ BaseTextFormField(
69
+ controller: _nameController,
70
+ hintText: S.of(context).contact_name,
71
+ validator: ContactNameValidator()),
72
+ Padding(
73
+ padding: EdgeInsets.only(top: 20),
74
+ child: Container(
75
+ child: InkWell(
76
+ onTap: () => _presentCurrencyPicker(context),
77
+ child: IgnorePointer(
78
+ child: BaseTextFormField(
79
+ controller: _currencyTypeController,
80
+ hintText: S.of(context).settings_currency,
81
+ suffixIcon: Row(
82
+ mainAxisSize: MainAxisSize.min,
83
+ mainAxisAlignment: MainAxisAlignment.end,
84
+ children: <Widget>[downArrow],
85
+ ),
86
+ )),
87
),
88
),
91
- Padding(
92
- padding: EdgeInsets.only(top: 20),
93
- child: Observer(
94
- builder: (_) => AddressTextField(
95
- controller: _addressController,
96
- options: [AddressTextFieldOption.qrCode],
97
- validator: AddressValidator(
98
- type: contactViewModel.currency),
99
- )),
100
- )
101
- ],
102
- ),
103
- ),
104
- bottomSectionPadding:
105
- EdgeInsets.only(left: 24, right: 24, bottom: 24),
106
- bottomSection: Row(
107
- children: <Widget>[
108
- Expanded(
109
- child: PrimaryButton(
110
- onPressed: () => contactViewModel.reset(),
111
- text: S.of(context).reset,
112
- color: Colors.red,
113
- textColor: Colors.white),
89
),
115
- SizedBox(width: 20),
116
- Expanded(
117
- child: Observer(
118
- builder: (_) => PrimaryButton(
119
- onPressed: () async {
120
- if (!_formKey.currentState.validate()) {
121
- return;
122
- }
123
-
124
- await contactViewModel.save();
125
- },
126
- text: S.of(context).save,
127
- color: Colors.green,
128
- textColor: Colors.white,
129
- isDisabled: !contactViewModel.isReady)))
90
+ Padding(
91
+ padding: EdgeInsets.only(top: 20),
92
+ child: Observer(
93
+ builder: (_) => AddressTextField(
94
+ controller: _addressController,
95
+ options: [AddressTextFieldOption.qrCode],
96
+ buttonColor: Theme.of(context).accentTextTheme.display2.color,
97
+ iconColor: PaletteDark.gray,
98
+ borderColor: Theme.of(context).primaryTextTheme.title.backgroundColor,
99
+ validator: AddressValidator(
100
+ type: contactViewModel.currency),
101
+ )),
102
+ )
103
],
131
- )),
132
- );
104
+ ),
105
+ ),
106
+ bottomSectionPadding:
107
+ EdgeInsets.only(left: 24, right: 24, bottom: 24),
108
+ bottomSection: Row(
109
+ children: <Widget>[
110
+ Expanded(
111
+ child: PrimaryButton(
112
+ onPressed: () {
113
+ contactViewModel.reset();
114
+ _nameController.text = '';
115
+ _addressController.text = '';
116
+ },
117
+ text: S.of(context).reset,
118
+ color: Colors.red,
119
+ textColor: Colors.white),
120
+ ),
121
+ SizedBox(width: 20),
122
+ Expanded(
123
+ child: Observer(
124
+ builder: (_) => PrimaryButton(
125
+ onPressed: () async {
126
+ if (!_formKey.currentState.validate()) {
127
+ return;
128
+ }
129
+
130
+ await contactViewModel.save();
131
+ },
132
+ text: S.of(context).save,
133
+ color: Palette.blueCraiola,
134
+ textColor: Colors.white,
135
+ isDisabled: !contactViewModel.isReady)))
136
+ ],
137
+ ));
138
}
139
140
void _presentCurrencyPicker(BuildContext context) {
lib/src/screens/nodes/node_create_or_edit_page.dart
+16
-100
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/palette.dart';
2
import 'package:flutter/material.dart';
3
import 'package:flutter/cupertino.dart';
4
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -6,6 +7,7 @@ import 'package:cake_wallet/generated/i18n.dart';
7
import 'package:cake_wallet/core/node_address_validator.dart';
8
import 'package:cake_wallet/core/node_port_validator.dart';
9
import 'package:cake_wallet/src/widgets/primary_button.dart';
10
+import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
11
import 'package:cake_wallet/src/screens/base_page.dart';
12
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
13
import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart';
@@ -77,32 +79,11 @@ class NodeCreateOrEditPage extends BasePage {
79
Row(
80
children: <Widget>[
81
Expanded(
80
- child: TextFormField(
81
- style: TextStyle(
82
- fontSize: 16.0,
83
- color: Theme.of(context)
84
- .primaryTextTheme
85
- .title
86
- .color),
87
- decoration: InputDecoration(
88
- hintStyle: TextStyle(
89
- color: Theme.of(context)
90
- .primaryTextTheme
91
- .caption
92
- .color,
93
- fontSize: 16),
94
- hintText: S.of(context).node_address,
95
- focusedBorder: UnderlineInputBorder(
96
- borderSide: BorderSide(
97
- color: Theme.of(context).dividerColor,
98
- width: 1.0)),
99
- enabledBorder: UnderlineInputBorder(
100
- borderSide: BorderSide(
101
- color: Theme.of(context).dividerColor,
102
- width: 1.0))),
82
+ child: BaseTextFormField(
83
controller: _addressController,
84
+ hintText: S.of(context).node_address,
85
validator: NodeAddressValidator(),
105
- ),
86
+ )
87
)
88
],
89
),
@@ -110,34 +91,13 @@ class NodeCreateOrEditPage extends BasePage {
91
Row(
92
children: <Widget>[
93
Expanded(
113
- child: TextFormField(
114
- style: TextStyle(
115
- fontSize: 16.0,
116
- color: Theme.of(context)
117
- .primaryTextTheme
118
- .title
119
- .color),
94
+ child: BaseTextFormField(
95
+ controller: _portController,
96
+ hintText: S.of(context).node_port,
97
keyboardType: TextInputType.numberWithOptions(
98
signed: false, decimal: false),
122
- decoration: InputDecoration(
123
- hintStyle: TextStyle(
124
- color: Theme.of(context)
125
- .primaryTextTheme
126
- .caption
127
- .color,
128
- fontSize: 16),
129
- hintText: S.of(context).node_port,
130
- focusedBorder: UnderlineInputBorder(
131
- borderSide: BorderSide(
132
- color: Theme.of(context).dividerColor,
133
- width: 1.0)),
134
- enabledBorder: UnderlineInputBorder(
135
- borderSide: BorderSide(
136
- color: Theme.of(context).dividerColor,
137
- width: 1.0))),
138
- controller: _portController,
99
validator: NodePortValidator(),
140
- ),
100
+ )
101
)
102
],
103
),
@@ -146,32 +106,10 @@ class NodeCreateOrEditPage extends BasePage {
106
Row(
107
children: <Widget>[
108
Expanded(
149
- child: TextFormField(
150
- style: TextStyle(
151
- fontSize: 16.0,
152
- color: Theme.of(context)
153
- .primaryTextTheme
154
- .title
155
- .color),
156
- decoration: InputDecoration(
157
- hintStyle: TextStyle(
158
- color: Theme.of(context)
159
- .primaryTextTheme
160
- .caption
161
- .color,
162
- fontSize: 16),
163
- hintText: S.of(context).login,
164
- focusedBorder: UnderlineInputBorder(
165
- borderSide: BorderSide(
166
- color: Theme.of(context).dividerColor,
167
- width: 1.0)),
168
- enabledBorder: UnderlineInputBorder(
169
- borderSide: BorderSide(
170
- color: Theme.of(context).dividerColor,
171
- width: 1.0))),
109
+ child: BaseTextFormField(
110
controller: _loginController,
173
- validator: (value) => null,
174
- ),
111
+ hintText: S.of(context).login,
112
+ )
113
)
114
],
115
),
@@ -179,32 +117,10 @@ class NodeCreateOrEditPage extends BasePage {
117
Row(
118
children: <Widget>[
119
Expanded(
182
- child: TextFormField(
183
- style: TextStyle(
184
- fontSize: 16.0,
185
- color: Theme.of(context)
186
- .primaryTextTheme
187
- .title
188
- .color),
189
- decoration: InputDecoration(
190
- hintStyle: TextStyle(
191
- color: Theme.of(context)
192
- .primaryTextTheme
193
- .caption
194
- .color,
195
- fontSize: 16),
196
- hintText: S.of(context).password,
197
- focusedBorder: UnderlineInputBorder(
198
- borderSide: BorderSide(
199
- color: Theme.of(context).dividerColor,
200
- width: 1.0)),
201
- enabledBorder: UnderlineInputBorder(
202
- borderSide: BorderSide(
203
- color: Theme.of(context).dividerColor,
204
- width: 1.0))),
120
+ child: BaseTextFormField(
121
controller: _passwordController,
206
- validator: (value) => null,
207
- ),
122
+ hintText: S.of(context).password,
123
+ )
124
)
125
],
126
)
@@ -237,7 +153,7 @@ class NodeCreateOrEditPage extends BasePage {
153
Navigator.of(context).pop();
154
},
155
text: S.of(context).save,
240
- color: Colors.green,
156
+ color: Palette.blueCraiola,
157
textColor: Colors.white,
158
isDisabled: !nodeCreateOrEditViewModel.isReady,
159
),
lib/src/screens/nodes/nodes_list_page.dart
+2
-2
@@ -24,7 +24,7 @@ class NodeListPage extends BasePage {
24
height: 32,
25
decoration: BoxDecoration(
26
borderRadius: BorderRadius.all(Radius.circular(16)),
27
- color: Theme.of(context).accentTextTheme.title.backgroundColor),
27
+ color: Theme.of(context).accentTextTheme.caption.color),
28
child: ButtonTheme(
29
minWidth: double.minPositive,
30
child: FlatButton(
@@ -51,7 +51,7 @@ class NodeListPage extends BasePage {
51
style: TextStyle(
52
fontSize: 14.0,
53
fontWeight: FontWeight.w600,
54
- color: Colors.blue),
54
+ color: Palette.blueCraiola),
55
)),
56
),
57
);
lib/src/screens/nodes/widgets/node_list_row.dart
+3
-3
@@ -23,9 +23,9 @@ class NodeListRow extends StandardListRow {
23
builder: (context, snapshot) {
24
switch (snapshot.connectionState) {
25
case ConnectionState.done:
26
- return NodeIndicator(isLive: snapshot.data as bool);
26
+ return NodeIndicator(isLive: (snapshot.data as bool)??false);
27
default:
28
- return NodeIndicator();
28
+ return NodeIndicator(isLive: false);
29
}
30
});
31
}
@@ -38,6 +38,6 @@ class NodeHeaderListRow extends StandardListRow {
38
@override
39
Widget buildTrailing(BuildContext context) {
40
return Icon(Icons.add,
41
- color: Theme.of(context).primaryTextTheme.title.color, size: 24.0);
41
+ color: Theme.of(context).accentTextTheme.subhead.color, size: 24.0);
42
}
43
}
lib/src/widgets/address_text_field.dart
+8
-7
@@ -1,4 +1,3 @@
1
-import 'package:cake_wallet/palette.dart';
1
import 'package:cake_wallet/routes.dart';
2
import 'package:flutter/material.dart';
3
import 'package:cake_wallet/generated/i18n.dart';
@@ -23,6 +22,7 @@ class AddressTextField extends StatelessWidget {
22
this.isBorderExist = true,
23
this.buttonColor,
24
this.borderColor,
25
+ this.iconColor,
26
this.textStyle,
27
this.hintStyle,
28
this.validator});
@@ -40,6 +40,7 @@ class AddressTextField extends StatelessWidget {
40
final bool isBorderExist;
41
final Color buttonColor;
42
final Color borderColor;
43
+ final Color iconColor;
44
final TextStyle textStyle;
45
final TextStyle hintStyle;
46
FocusNode focusNode;
@@ -55,7 +56,7 @@ class AddressTextField extends StatelessWidget {
56
focusNode: focusNode,
57
style: textStyle ?? TextStyle(
58
fontSize: 16,
58
- color: Colors.white
59
+ color: Theme.of(context).primaryTextTheme.title.color
60
),
61
decoration: InputDecoration(
62
suffixIcon: SizedBox(
@@ -64,7 +65,7 @@ class AddressTextField extends StatelessWidget {
65
),
66
hintStyle: hintStyle ?? TextStyle(
67
fontSize: 16,
67
- color: PaletteDark.darkCyanBlue
68
+ color: Theme.of(context).hintColor
69
),
70
hintText: placeholder ?? S.current.widgets_address,
71
focusedBorder: isBorderExist
@@ -113,7 +114,7 @@ class AddressTextField extends StatelessWidget {
114
BorderRadius.all(Radius.circular(6))),
115
child: Image.asset(
116
'assets/images/duplicate.png',
116
- color: Theme.of(context).primaryTextTheme.display1.decorationColor,
117
+ color: iconColor ?? Theme.of(context).primaryTextTheme.display1.decorationColor,
118
)),
119
)),
120
],
@@ -131,7 +132,7 @@ class AddressTextField extends StatelessWidget {
132
borderRadius:
133
BorderRadius.all(Radius.circular(6))),
134
child: Image.asset('assets/images/qr_code_icon.png',
134
- color: Theme.of(context).primaryTextTheme.display1.decorationColor,
135
+ color: iconColor ?? Theme.of(context).primaryTextTheme.display1.decorationColor,
136
)),
137
))
138
],
@@ -152,7 +153,7 @@ class AddressTextField extends StatelessWidget {
153
BorderRadius.all(Radius.circular(6))),
154
child: Image.asset(
155
'assets/images/open_book.png',
155
- color: Theme.of(context).primaryTextTheme.display1.decorationColor,
156
+ color: iconColor ?? Theme.of(context).primaryTextTheme.display1.decorationColor,
157
)),
158
))
159
],
@@ -173,7 +174,7 @@ class AddressTextField extends StatelessWidget {
174
BorderRadius.all(Radius.circular(6))),
175
child: Image.asset(
176
'assets/images/receive_icon_raw.png',
176
- color: Theme.of(context).primaryTextTheme.display1.decorationColor,
177
+ color: iconColor ?? Theme.of(context).primaryTextTheme.display1.decorationColor,
178
)),
179
)),
180
],
lib/src/widgets/base_alert_dialog.dart
+2
-2
@@ -45,7 +45,7 @@ class BaseAlertDialog extends StatelessWidget {
45
Flexible(
46
child: Container(
47
height: 52,
48
- padding: EdgeInsets.only(left: 12, right: 12),
48
+ padding: EdgeInsets.only(left: 6, right: 6),
49
color: Palette.blueCraiola,
50
child: ButtonTheme(
51
minWidth: double.infinity,
@@ -70,7 +70,7 @@ class BaseAlertDialog extends StatelessWidget {
70
Flexible(
71
child: Container(
72
height: 52,
73
- padding: EdgeInsets.only(left: 12, right: 12),
73
+ padding: EdgeInsets.only(left: 6, right: 6),
74
color: Palette.alizarinRed,
75
child: ButtonTheme(
76
minWidth: double.infinity,
lib/src/widgets/standard_list.dart
+17
-11
@@ -1,3 +1,4 @@
1
+import 'package:cake_wallet/palette.dart';
2
import 'package:flutter/cupertino.dart';
3
import 'package:flutter/material.dart';
4
@@ -39,7 +40,7 @@ class StandardListRow extends StatelessWidget {
40
Text(title,
41
style: TextStyle(
42
fontSize: 14,
42
- fontWeight: FontWeight.w500,
43
+ fontWeight: FontWeight.normal,
44
color: _titleColor(context)))
45
]));
46
}
@@ -47,21 +48,24 @@ class StandardListRow extends StatelessWidget {
48
Widget buildTrailing(BuildContext context) => null;
49
50
Color _titleColor(BuildContext context) => isSelected
50
- ? Color.fromRGBO(20, 200, 71, 1)
51
+ ? Palette.blueCraiola
52
: Theme.of(context).primaryTextTheme.title.color;
53
54
Color _backgroundColor(BuildContext context) {
55
// return Theme.of(context).accentTextTheme.subtitle.decorationColor;
55
- return Theme.of(context).accentTextTheme.title.backgroundColor;
56
+ return Theme.of(context).backgroundColor;
57
}
58
}
59
60
class SectionHeaderListRow extends StatelessWidget {
61
@override
62
Widget build(BuildContext context) => Column(children: [
62
- StandardListSeparator(),
63
- Container(width: double.infinity, height: 40, color: Colors.white),
64
- StandardListSeparator()
63
+ StandardListSeparator(padding: EdgeInsets.only(left: 24)),
64
+ Container(
65
+ width: double.infinity,
66
+ height: 40,
67
+ color: Theme.of(context).backgroundColor),
68
+ //StandardListSeparator(padding: EdgeInsets.only(left: 24))
69
]);
70
}
71
@@ -75,8 +79,10 @@ class StandardListSeparator extends StatelessWidget {
79
return Container(
80
height: 1,
81
padding: padding,
78
- color: Theme.of(context).accentTextTheme.title.backgroundColor,
79
- child: Container(height: 1, color: Color.fromRGBO(219, 227, 243, 1)));
82
+ color: Theme.of(context).backgroundColor,
83
+ child: Container(
84
+ height: 1,
85
+ color: Theme.of(context).primaryTextTheme.title.backgroundColor));
86
}
87
}
88
@@ -126,9 +132,9 @@ class SectionStandardList extends StatelessWidget {
132
final items = <Widget>[];
133
134
for (var sectionIndex = 0; sectionIndex < sectionCount; sectionIndex++) {
129
- if (sectionIndex == 0) {
135
+ /*if (sectionIndex == 0) {
136
items.add(StandardListSeparator());
131
- }
137
+ }*/
138
139
final itemCount = itemCounter(sectionIndex);
140
@@ -140,7 +146,7 @@ class SectionStandardList extends StatelessWidget {
146
147
items.add(sectionIndex + 1 != sectionCount
148
? SectionHeaderListRow()
143
- : StandardListSeparator());
149
+ : StandardListSeparator(padding: EdgeInsets.only(left: 24)));
150
}
151
152
return items;
lib/themes.dart
+6
@@ -152,6 +152,9 @@ class Themes {
152
color: Palette.blueCraiola, // first gradient color (menu header)
153
decorationColor: Palette.pinkFlamingo // second gradient color(menu header)
154
),
155
+ display2: TextStyle(
156
+ color: Palette.shadowWhite, // action button color (address text field)
157
+ ),
158
),
159
160
@@ -315,6 +318,9 @@ class Themes {
318
color: PaletteDark.deepPurpleBlue, // first gradient color (menu header)
319
decorationColor: PaletteDark.deepPurpleBlue // second gradient color(menu header)
320
),
321
+ display2: TextStyle(
322
+ color: PaletteDark.nightBlue, // action button color (address text field)
323
+ ),
324
),
325
326
lib/view_model/contact_list/contact_view_model.dart
+5
-3
@@ -16,7 +16,7 @@ abstract class ContactViewModelBase with Store {
16
_contact = contact {
17
name = _contact?.name;
18
address = _contact?.address;
19
- currency = _contact?.type ?? _wallet.currency;
19
+ currency = _contact?.type; //_wallet.currency;
20
}
21
22
@observable
@@ -33,7 +33,8 @@ abstract class ContactViewModelBase with Store {
33
34
@computed
35
bool get isReady =>
36
- (name?.isNotEmpty ?? false) && (address?.isNotEmpty ?? false);
36
+ (name?.isNotEmpty ?? false) && (currency?.toString()?.isNotEmpty ?? false)
37
+ && (address?.isNotEmpty ?? false);
38
39
final List<CryptoCurrency> currencies;
40
final ContactService _contactService;
@@ -44,7 +45,8 @@ abstract class ContactViewModelBase with Store {
45
void reset() {
46
address = '';
47
name = '';
47
- currency = _wallet.currency;
48
+ //currency = _wallet.currency;
49
+ currency = null;
50
}
51
52
Future save() async {