CAKE-135 | removed validation alert in the send and exchange pages when clear/reset buttons was pushed (applied _formKey.currentState.reset())
OleksandrSobol committed
Oct 30, 2020 at 14:42 UTC
18e2df4f4076f1189e9e0a6982652a915ed2ce93
3 files changed
+9
-2
lib/src/screens/exchange/exchange_page.dart
+4
-1
@@ -61,7 +61,10 @@ class ExchangePage extends BasePage {
61
62
@override
63
Widget trailing(BuildContext context) => TrailButton(
64
- caption: S.of(context).reset, onPressed: () => exchangeViewModel.reset());
64
+ caption: S.of(context).reset, onPressed: () {
65
+ _formKey.currentState.reset();
66
+ exchangeViewModel.reset();
67
+ });
68
69
@override
70
Widget body(BuildContext context) {
lib/src/screens/send/send_page.dart
+4
-1
@@ -70,7 +70,10 @@ class SendPage extends BasePage {
70
71
@override
72
Widget trailing(context) => TrailButton(
73
- caption: S.of(context).clear, onPressed: () => sendViewModel.reset());
73
+ caption: S.of(context).clear, onPressed: () {
74
+ _formKey.currentState.reset();
75
+ sendViewModel.reset();
76
+ });
77
78
@override
79
Widget body(BuildContext context) {
lib/view_model/send/send_view_model.dart
+1
@@ -107,6 +107,7 @@ abstract class SendViewModelBase with Store {
107
108
@action
109
void reset() {
110
+ sendAll = false;
111
cryptoAmount = '';
112
fiatAmount = '';
113
address = '';