add Disable fiat mode

This commit is contained in:
Serhii
2022-11-04 13:58:04 +02:00
parent 289f382eda
commit d4c7004a3c
11 changed files with 76 additions and 32 deletions
@@ -57,7 +57,9 @@ class TransactionsPage extends StatelessWidget {
formattedDate: DateFormat('HH:mm')
.format(transaction.date),
formattedAmount: item.formattedCryptoAmount,
formattedFiatAmount: item.formattedFiatAmount,
formattedFiatAmount:
dashboardViewModel.balanceViewModel.disableFiat
? '' : item.formattedFiatAmount,
isPending: transaction.isPending));
}
@@ -74,9 +74,12 @@ class ExchangeTradePage extends BasePage {
}
class ExchangeTradeForm extends StatefulWidget {
ExchangeTradeForm(this.exchangeTradeViewModel);
ExchangeTradeForm(this.exchangeTradeViewModel)
: disableFiat =
exchangeTradeViewModel.sendViewModel.balanceViewModel.disableFiat;
final ExchangeTradeViewModel exchangeTradeViewModel;
final bool disableFiat;
@override
ExchangeTradeState createState() => ExchangeTradeState();
@@ -378,9 +381,11 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
});
},
actionLeftButton: () => Navigator.of(context).pop(),
feeFiatAmount: widget.exchangeTradeViewModel.sendViewModel.pendingTransactionFeeFiatAmount
feeFiatAmount: widget.disableFiat ? ''
: widget.exchangeTradeViewModel.sendViewModel.pendingTransactionFeeFiatAmount
+ ' ' + widget.exchangeTradeViewModel.sendViewModel.fiat.title,
fiatAmountValue: widget.exchangeTradeViewModel.sendViewModel
fiatAmountValue: widget.disableFiat ? ''
: widget.exchangeTradeViewModel.sendViewModel
.pendingTransactionFiatAmount +
' ' +
widget.exchangeTradeViewModel.sendViewModel.fiat.title,
+6 -8
View File
@@ -386,16 +386,14 @@ class SendPage extends BasePage {
amount: S.of(context).send_amount,
amountValue:
sendViewModel.pendingTransaction!.amountFormatted,
fiatAmountValue:
sendViewModel.pendingTransactionFiatAmount +
' ' +
sendViewModel.fiat.title,
fiatAmountValue: sendViewModel.balanceViewModel.disableFiat
? '' : sendViewModel.pendingTransactionFiatAmount +
' ' + sendViewModel.fiat.title,
fee: S.of(context).send_fee,
feeValue: sendViewModel.pendingTransaction!.feeFormatted,
feeFiatAmount:
sendViewModel.pendingTransactionFeeFiatAmount +
' ' +
sendViewModel.fiat.title,
feeFiatAmount: sendViewModel.balanceViewModel.disableFiat
? '' : sendViewModel.pendingTransactionFeeFiatAmount +
' ' + sendViewModel.fiat.title,
outputs: sendViewModel.outputs,
rightButtonText: S.of(context).ok,
leftButtonText: S.of(context).cancel,
+4 -2
View File
@@ -332,6 +332,8 @@ class SendCardState extends State<SendCard>
],
),
)),
sendViewModel.balanceViewModel.disableFiat ?
Container () :
Padding(
padding: const EdgeInsets.only(top: 20),
child: BaseTextFormField(
@@ -438,8 +440,8 @@ class SendCardState extends State<SendCard>
Padding(
padding:
EdgeInsets.only(top: 5),
child: Text(
output
child: sendViewModel.balanceViewModel.disableFiat ?
Container () : Text(output
.estimatedFeeFiatAmount
+ ' ' +
sendViewModel
+8 -5
View File
@@ -29,18 +29,20 @@ class SettingsPage extends BasePage {
@override
Widget body(BuildContext context) {
// FIX-ME: Added `context` it was not used here before, maby bug ?
return SectionStandardList(
return Observer(builder: (_) {
final sections = settingsViewModel.getSections();
return SectionStandardList(
context: context,
sectionCount: settingsViewModel.sections.length,
sectionCount: sections.length,
itemCounter: (int sectionIndex) {
if (sectionIndex < settingsViewModel.sections.length) {
return settingsViewModel.sections[sectionIndex].length;
if (sectionIndex < sections.length) {
return sections[sectionIndex].length;
}
return 0;
},
itemBuilder: (_, sectionIndex, itemIndex) {
final item = settingsViewModel.sections[sectionIndex][itemIndex];
final item = sections[sectionIndex][itemIndex];
if (item is PickerListItem) {
return Observer(builder: (_) {
@@ -94,5 +96,6 @@ class SettingsPage extends BasePage {
return Container();
});
});
}
}