CAKE-135 | removed validation alert in the send and exchange pages when clear/reset buttons was pushed (applied _formKey.currentState.reset())

This commit is contained in:
OleksandrSobol 2020-10-30 14:42:23 +02:00
parent e7574c51f6
commit 18e2df4f40
3 changed files with 9 additions and 2 deletions

View file

@ -61,7 +61,10 @@ class ExchangePage extends BasePage {
@override
Widget trailing(BuildContext context) => TrailButton(
caption: S.of(context).reset, onPressed: () => exchangeViewModel.reset());
caption: S.of(context).reset, onPressed: () {
_formKey.currentState.reset();
exchangeViewModel.reset();
});
@override
Widget body(BuildContext context) {

View file

@ -70,7 +70,10 @@ class SendPage extends BasePage {
@override
Widget trailing(context) => TrailButton(
caption: S.of(context).clear, onPressed: () => sendViewModel.reset());
caption: S.of(context).clear, onPressed: () {
_formKey.currentState.reset();
sendViewModel.reset();
});
@override
Widget body(BuildContext context) {

View file

@ -107,6 +107,7 @@ abstract class SendViewModelBase with Store {
@action
void reset() {
sendAll = false;
cryptoAmount = '';
fiatAmount = '';
address = '';