mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
Merge pull request #156 from cypherstack/ui-fixes
set form state exchange on ui change
This commit is contained in:
commit
abcb27ba69
1 changed files with 15 additions and 0 deletions
|
@ -5,6 +5,7 @@ import 'package:flutter_svg/svg.dart';
|
|||
import 'package:stackwallet/models/exchange/response_objects/estimate.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/exchange/change_now/change_now_exchange.dart';
|
||||
import 'package:stackwallet/services/exchange/exchange.dart';
|
||||
import 'package:stackwallet/services/exchange/exchange_response.dart';
|
||||
import 'package:stackwallet/services/exchange/simpleswap/simpleswap_exchange.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
|
@ -46,6 +47,9 @@ class ExchangeProviderOptions extends ConsumerWidget {
|
|||
ChangeNowExchange.exchangeName) {
|
||||
ref.read(currentExchangeNameStateProvider.state).state =
|
||||
ChangeNowExchange.exchangeName;
|
||||
ref.read(exchangeFormStateProvider).exchange =
|
||||
Exchange.fromName(
|
||||
ref.read(currentExchangeNameStateProvider.state).state);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
@ -69,6 +73,10 @@ class ExchangeProviderOptions extends ConsumerWidget {
|
|||
ref
|
||||
.read(currentExchangeNameStateProvider.state)
|
||||
.state = value;
|
||||
ref.read(exchangeFormStateProvider).exchange =
|
||||
Exchange.fromName(ref
|
||||
.read(currentExchangeNameStateProvider.state)
|
||||
.state);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
@ -214,6 +222,9 @@ class ExchangeProviderOptions extends ConsumerWidget {
|
|||
SimpleSwapExchange.exchangeName) {
|
||||
ref.read(currentExchangeNameStateProvider.state).state =
|
||||
SimpleSwapExchange.exchangeName;
|
||||
ref.read(exchangeFormStateProvider).exchange =
|
||||
Exchange.fromName(
|
||||
ref.read(currentExchangeNameStateProvider.state).state);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
@ -237,6 +248,10 @@ class ExchangeProviderOptions extends ConsumerWidget {
|
|||
ref
|
||||
.read(currentExchangeNameStateProvider.state)
|
||||
.state = value;
|
||||
ref.read(exchangeFormStateProvider).exchange =
|
||||
Exchange.fromName(ref
|
||||
.read(currentExchangeNameStateProvider.state)
|
||||
.state);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue