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 {
|
class ExchangeCurrencySelectionView extends StatefulWidget {
|
||||||
const ExchangeCurrencySelectionView({
|
const ExchangeCurrencySelectionView({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.exchangeName,
|
|
||||||
required this.willChange,
|
required this.willChange,
|
||||||
required this.paired,
|
required this.paired,
|
||||||
required this.isFixedRate,
|
required this.isFixedRate,
|
||||||
required this.willChangeIsSend,
|
required this.willChangeIsSend,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final String exchangeName;
|
|
||||||
final Currency? willChange;
|
final Currency? willChange;
|
||||||
final Currency? paired;
|
final Currency? paired;
|
||||||
final bool isFixedRate;
|
final bool isFixedRate;
|
||||||
|
@ -109,7 +107,6 @@ class _ExchangeCurrencySelectionViewState
|
||||||
Future<Currency?> _getCurrency(String ticker) {
|
Future<Currency?> _getCurrency(String ticker) {
|
||||||
return ExchangeDataLoadingService.instance.isar.currencies
|
return ExchangeDataLoadingService.instance.isar.currencies
|
||||||
.where()
|
.where()
|
||||||
.exchangeNameEqualTo(widget.exchangeName)
|
|
||||||
.filter()
|
.filter()
|
||||||
.tickerEqualTo(ticker, caseSensitive: false)
|
.tickerEqualTo(ticker, caseSensitive: false)
|
||||||
.group((q) => widget.isFixedRate
|
.group((q) => widget.isFixedRate
|
||||||
|
@ -127,7 +124,6 @@ class _ExchangeCurrencySelectionViewState
|
||||||
Future<List<Pair>> _loadAvailablePairs() {
|
Future<List<Pair>> _loadAvailablePairs() {
|
||||||
final query = ExchangeDataLoadingService.instance.isar.pairs
|
final query = ExchangeDataLoadingService.instance.isar.pairs
|
||||||
.where()
|
.where()
|
||||||
.exchangeNameEqualTo(widget.exchangeName)
|
|
||||||
.filter()
|
.filter()
|
||||||
.group((q) => widget.isFixedRate
|
.group((q) => widget.isFixedRate
|
||||||
? q
|
? q
|
||||||
|
@ -153,7 +149,6 @@ class _ExchangeCurrencySelectionViewState
|
||||||
Future<List<Currency>> _getCurrencies() async {
|
Future<List<Currency>> _getCurrencies() async {
|
||||||
return ExchangeDataLoadingService.instance.isar.currencies
|
return ExchangeDataLoadingService.instance.isar.currencies
|
||||||
.where()
|
.where()
|
||||||
.exchangeNameEqualTo(widget.exchangeName)
|
|
||||||
.filter()
|
.filter()
|
||||||
.group((q) => widget.isFixedRate
|
.group((q) => widget.isFixedRate
|
||||||
? q
|
? q
|
||||||
|
@ -166,6 +161,7 @@ class _ExchangeCurrencySelectionViewState
|
||||||
.rateTypeEqualTo(SupportedRateType.estimated))
|
.rateTypeEqualTo(SupportedRateType.estimated))
|
||||||
.sortByIsStackCoin()
|
.sortByIsStackCoin()
|
||||||
.thenByName()
|
.thenByName()
|
||||||
|
.distinctByTicker(caseSensitive: false)
|
||||||
.findAll();
|
.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,10 +241,6 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
||||||
.extension<StackColors>()!
|
.extension<StackColors>()!
|
||||||
.background,
|
.background,
|
||||||
child: ExchangeCurrencySelectionView(
|
child: ExchangeCurrencySelectionView(
|
||||||
exchangeName: ref
|
|
||||||
.read(currentExchangeNameStateProvider
|
|
||||||
.state)
|
|
||||||
.state,
|
|
||||||
willChange: willChange,
|
willChange: willChange,
|
||||||
paired: paired,
|
paired: paired,
|
||||||
isFixedRate: isFixedRate,
|
isFixedRate: isFixedRate,
|
||||||
|
@ -263,8 +259,6 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
||||||
: await Navigator.of(context).push(
|
: await Navigator.of(context).push(
|
||||||
MaterialPageRoute<dynamic>(
|
MaterialPageRoute<dynamic>(
|
||||||
builder: (_) => ExchangeCurrencySelectionView(
|
builder: (_) => ExchangeCurrencySelectionView(
|
||||||
exchangeName:
|
|
||||||
ref.read(currentExchangeNameStateProvider.state).state,
|
|
||||||
willChange: willChange,
|
willChange: willChange,
|
||||||
paired: paired,
|
paired: paired,
|
||||||
isFixedRate: isFixedRate,
|
isFixedRate: isFixedRate,
|
||||||
|
|
Loading…
Reference in a new issue