mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-23 19:05:51 +00:00
show all available paired coins across exchange providers
This commit is contained in:
parent
ae697928a6
commit
24baeb9ff5
2 changed files with 1 additions and 11 deletions
|
@ -26,14 +26,12 @@ import 'package:stackwallet/widgets/textfield_icon_button.dart';
|
|||
class ExchangeCurrencySelectionView extends StatefulWidget {
|
||||
const ExchangeCurrencySelectionView({
|
||||
Key? key,
|
||||
required this.exchangeName,
|
||||
required this.willChange,
|
||||
required this.paired,
|
||||
required this.isFixedRate,
|
||||
required this.willChangeIsSend,
|
||||
}) : super(key: key);
|
||||
|
||||
final String exchangeName;
|
||||
final Currency? willChange;
|
||||
final Currency? paired;
|
||||
final bool isFixedRate;
|
||||
|
@ -109,7 +107,6 @@ class _ExchangeCurrencySelectionViewState
|
|||
Future<Currency?> _getCurrency(String ticker) {
|
||||
return ExchangeDataLoadingService.instance.isar.currencies
|
||||
.where()
|
||||
.exchangeNameEqualTo(widget.exchangeName)
|
||||
.filter()
|
||||
.tickerEqualTo(ticker, caseSensitive: false)
|
||||
.group((q) => widget.isFixedRate
|
||||
|
@ -127,7 +124,6 @@ class _ExchangeCurrencySelectionViewState
|
|||
Future<List<Pair>> _loadAvailablePairs() {
|
||||
final query = ExchangeDataLoadingService.instance.isar.pairs
|
||||
.where()
|
||||
.exchangeNameEqualTo(widget.exchangeName)
|
||||
.filter()
|
||||
.group((q) => widget.isFixedRate
|
||||
? q
|
||||
|
@ -153,7 +149,6 @@ class _ExchangeCurrencySelectionViewState
|
|||
Future<List<Currency>> _getCurrencies() async {
|
||||
return ExchangeDataLoadingService.instance.isar.currencies
|
||||
.where()
|
||||
.exchangeNameEqualTo(widget.exchangeName)
|
||||
.filter()
|
||||
.group((q) => widget.isFixedRate
|
||||
? q
|
||||
|
@ -166,6 +161,7 @@ class _ExchangeCurrencySelectionViewState
|
|||
.rateTypeEqualTo(SupportedRateType.estimated))
|
||||
.sortByIsStackCoin()
|
||||
.thenByName()
|
||||
.distinctByTicker(caseSensitive: false)
|
||||
.findAll();
|
||||
}
|
||||
|
||||
|
|
|
@ -241,10 +241,6 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
|||
.extension<StackColors>()!
|
||||
.background,
|
||||
child: ExchangeCurrencySelectionView(
|
||||
exchangeName: ref
|
||||
.read(currentExchangeNameStateProvider
|
||||
.state)
|
||||
.state,
|
||||
willChange: willChange,
|
||||
paired: paired,
|
||||
isFixedRate: isFixedRate,
|
||||
|
@ -263,8 +259,6 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
|||
: await Navigator.of(context).push(
|
||||
MaterialPageRoute<dynamic>(
|
||||
builder: (_) => ExchangeCurrencySelectionView(
|
||||
exchangeName:
|
||||
ref.read(currentExchangeNameStateProvider.state).state,
|
||||
willChange: willChange,
|
||||
paired: paired,
|
||||
isFixedRate: isFixedRate,
|
||||
|
|
Loading…
Reference in a new issue