- Fix not filling fiat amount

- Fix conflicts with master
This commit is contained in:
OmarHatem 2022-12-12 18:01:42 +02:00
parent 01024b6694
commit 826ae46b07
2 changed files with 11 additions and 6 deletions

View file

@ -29,12 +29,11 @@ class SendPage extends BasePage {
SendPage({
required this.sendViewModel,
this.initialPaymentRequest,
}) : _formKey = GlobalKey<FormState>(),fiatFromSettings = settingsViewModel.fiatCurrency;
}) : _formKey = GlobalKey<FormState>();
final SendViewModel sendViewModel;
final GlobalKey<FormState> _formKey;
final controller = PageController(initialPage: 0);
final FiatCurrency fiatFromSettings;
final PaymentRequest? initialPaymentRequest;
bool _effectsInstalled = false;

View file

@ -43,8 +43,8 @@ class SendCardState extends State<SendCard>
required this.output,
required this.sendViewModel,
this.initialPaymentRequest})
: addressController = TextEditingController(text: initialPaymentRequest?.address.toLowerCase()),
cryptoAmountController = TextEditingController(text: initialPaymentRequest?.amount),
: addressController = TextEditingController(),
cryptoAmountController = TextEditingController(),
fiatAmountController = TextEditingController(),
noteController = TextEditingController(),
extractedAddressController = TextEditingController(),
@ -545,8 +545,7 @@ class SendCardState extends State<SendCard>
if (output.address.isNotEmpty) {
addressController.text = output.address;
}
if (output.cryptoAmount.isNotEmpty ||
sendViewModel.walletCurrencyName != initialPaymentRequest?.scheme.toLowerCase()) {
if (output.cryptoAmount.isNotEmpty) {
cryptoAmountController.text = output.cryptoAmount;
}
fiatAmountController.text = output.fiatAmount;
@ -640,6 +639,13 @@ class SendCardState extends State<SendCard>
extractedAddressController.text = extractedAddress;
});
if (initialPaymentRequest != null &&
sendViewModel.walletCurrencyName != initialPaymentRequest!.scheme.toLowerCase()) {
addressController.text = initialPaymentRequest!.address;
cryptoAmountController.text = initialPaymentRequest!.amount;
noteController.text = initialPaymentRequest!.note;
}
_effectsInstalled = true;
}