remove global swap warning message (will be replaced in future with per exchange info)

This commit is contained in:
julian 2023-05-03 15:46:51 -06:00
parent eeda23417c
commit 3d9a8c3a3c
2 changed files with 12 additions and 48 deletions

View file

@ -712,7 +712,6 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
ref.read(efSendAmountProvider.notifier).state = null;
ref.read(efReceiveAmountProvider.notifier).state = null;
ref.read(efReversedProvider.notifier).state = false;
ref.read(efWarningProvider.notifier).state = "";
ref.read(efRefreshingProvider.notifier).state = false;
ref.read(efCurrencyPairProvider).setSend(null, notifyListeners: true);
ref
@ -839,12 +838,12 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
SizedBox(
height: isDesktop ? 10 : 4,
),
if (ref.watch(efWarningProvider).isNotEmpty &&
!ref.watch(efReversedProvider))
Text(
ref.watch(efWarningProvider),
style: STextStyles.errorSmall(context),
),
// if (ref.watch(efWarningProvider).isNotEmpty &&
// !ref.watch(efReversedProvider))
// Text(
// ref.watch(efWarningProvider),
// style: STextStyles.errorSmall(context),
// ),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -924,12 +923,12 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
ref.watch(efExchangeProvider).name ==
ChangeNowExchange.exchangeName,
),
if (ref.watch(efWarningProvider).isNotEmpty &&
ref.watch(efReversedProvider))
Text(
ref.watch(efWarningProvider),
style: STextStyles.errorSmall(context),
),
// if (ref.watch(efWarningProvider).isNotEmpty &&
// ref.watch(efReversedProvider))
// Text(
// ref.watch(efWarningProvider),
// style: STextStyles.errorSmall(context),
// ),
SizedBox(
height: isDesktop ? 20 : 12,
),

View file

@ -79,38 +79,3 @@ final efCanExchangeProvider = StateProvider<bool>((ref) {
});
final efRefreshingProvider = StateProvider<bool>((ref) => false);
final efWarningProvider = StateProvider((ref) {
// if (ref.watch(efReversedProvider)) {
// final _receiveCurrency =
// ref.watch(efCurrencyPairProvider.select((value) => value.receive));
// final _receiveAmount = ref.watch(efReceiveAmountProvider);
// if (_receiveCurrency != null && _receiveAmount != null) {
// final range = ref.watch(efRangeProvider);
// if (range?.min != null &&
// _receiveAmount < range!.min! &&
// _receiveAmount > Decimal.zero) {
// return "Min receive amount ${range.min!.toString()} ${_receiveCurrency.ticker.toUpperCase()}";
// } else if (range?.max != null &&
// _receiveAmount > ref.watch(efRangeProvider)!.max!) {
// return "Max receive amount $range!.max!.toString()} ${_receiveCurrency.ticker.toUpperCase()}";
// }
// }
// } else {
// final _sendCurrency =
// ref.watch(efCurrencyPairProvider.select((value) => value.send));
// final _sendAmount = ref.watch(efSendAmountProvider);
// if (_sendCurrency != null && _sendAmount != null) {
// final range = ref.watch(efRangeProvider);
// if (range?.min != null &&
// _sendAmount < range!.min! &&
// _sendAmount > Decimal.zero) {
// return "Min send amount ${range.min!.toString()} ${_sendCurrency.ticker.toUpperCase()}";
// } else if (range?.max != null && _sendAmount > range!.max!) {
// return "Max send amount ${range.max!.toString()} ${_sendCurrency.ticker.toUpperCase()}";
// }
// }
// }
return "";
});