This commit is contained in:
M
2020-09-28 22:02:30 +03:00
parent e3678d2cf9
commit e08e10bc35
7 changed files with 59 additions and 14 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ class RootState extends State<Root> with WidgetsBindingObserver {
});
}
return widget.child;
return WillPopScope(onWillPop: () async => false, child: widget.child);
}
void _reset() {
+16 -2
View File
@@ -425,8 +425,10 @@ class SendPage extends BasePage {
EdgeInsets.only(left: 24, right: 24, bottom: 24),
bottomSection: Observer(builder: (_) {
return LoadingPrimaryButton(
onPressed: () {
if (_formKey.currentState.validate()) {}
onPressed: () async {
if (_formKey.currentState.validate()) {
await sendViewModel.createTransaction();
}
},
text: S.of(context).send,
color: Theme.of(context).accentTextTheme.body2.color,
@@ -445,6 +447,18 @@ class SendPage extends BasePage {
return;
}
_cryptoAmountController.addListener(() {
final amount = _cryptoAmountController.text;
if (sendViewModel.sendAll && amount != S.current.all) {
sendViewModel.sendAll = false;
}
if (amount != sendViewModel.cryptoAmount) {
sendViewModel.setCryptoAmount(amount);
}
});
reaction((_) => sendViewModel.sendAll, (bool all) {
if (all) {
_cryptoAmountController.text = S.current.all;