Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/notifications/notification_card_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ class NotificationCardLayout extends StatelessWidget {
),
if (read)
Positioned.fill(
child: RoundedContainer(color: colors.background.withOpacity(0.5)),
child: RoundedContainer(
color: colors.background.withValues(alpha: 0.5),
),
),
],
);
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/buy_view/buy_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ class _BuyFormState extends ConsumerState<BuyForm> {
? Theme.of(context)
.extension<StackColors>()!
.currencyListItemBG
.withOpacity(_hovering1 ? 0.3 : 0)
.withValues(alpha: _hovering1 ? 0.3 : 0)
: Theme.of(
context,
).extension<StackColors>()!.textFieldDefaultBG,
Expand Down Expand Up @@ -906,7 +906,7 @@ class _BuyFormState extends ConsumerState<BuyForm> {
? Theme.of(context)
.extension<StackColors>()!
.currencyListItemBG
.withOpacity(_hovering2 ? 0.3 : 0)
.withValues(alpha: _hovering2 ? 0.3 : 0)
: Theme.of(
context,
).extension<StackColors>()!.textFieldDefaultBG,
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/buy_view/buy_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class _BuyViewState extends ConsumerState<BuyView> {
Container(
color: Theme.of(
context,
).extension<StackColors>()!.overlay.withOpacity(0.7),
).extension<StackColors>()!.overlay.withValues(alpha: 0.7),
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: const StackDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,18 @@ class _ExchangeCurrencySelectionViewState
showDialog<void>(
context: context,
barrierDismissible: false,
builder:
(_) => WillPopScope(
onWillPop: () async => false,
child: Container(
color: Theme.of(
context,
).extension<StackColors>()!.overlay.withOpacity(0.6),
child: const CustomLoadingOverlay(
message: "Loading currencies",
eventBus: null,
),
),
builder: (_) => WillPopScope(
onWillPop: () async => false,
child: Container(
color: Theme.of(
context,
).extension<StackColors>()!.overlay.withValues(alpha: 0.6),
child: const CustomLoadingOverlay(
message: "Loading currencies",
eventBus: null,
),
),
),
),
);

Expand All @@ -101,36 +100,33 @@ class _ExchangeCurrencySelectionViewState
Future<List<AggregateCurrency>> _loadCurrencies() async {
await ExchangeDataLoadingService.instance.initDB();
final isar = await ExchangeDataLoadingService.instance.isar;
final currencies =
await isar.currencies
.where()
.filter()
.isFiatEqualTo(false)
.and()
.group(
(q) =>
widget.isFixedRate
? q
.rateTypeEqualTo(SupportedRateType.both)
.or()
.rateTypeEqualTo(SupportedRateType.fixed)
: q
.rateTypeEqualTo(SupportedRateType.both)
.or()
.rateTypeEqualTo(SupportedRateType.estimated),
)
.sortByIsStackCoin()
.thenByName()
.findAll();
final currencies = await isar.currencies
.where()
.filter()
.isFiatEqualTo(false)
.and()
.group(
(q) => widget.isFixedRate
? q
.rateTypeEqualTo(SupportedRateType.both)
.or()
.rateTypeEqualTo(SupportedRateType.fixed)
: q
.rateTypeEqualTo(SupportedRateType.both)
.or()
.rateTypeEqualTo(SupportedRateType.estimated),
)
.sortByIsStackCoin()
.thenByName()
.findAll();

// If using Tor, filter exchanges which do not support Tor.
if (Prefs.instance.useTor) {
if (Exchange.exchangeNamesWithTorSupport.isNotEmpty) {
currencies.removeWhere(
(element) =>
!Exchange.exchangeNamesWithTorSupport.contains(
element.exchangeName,
),
(element) => !Exchange.exchangeNamesWithTorSupport.contains(
element.exchangeName,
),
);
}
}
Expand Down Expand Up @@ -163,20 +159,18 @@ class _ExchangeCurrencySelectionViewState
results.remove(widget.pairedCurrency);
}

final walletCoins =
results
.where(
(currency) =>
AppConfig.coins
.where(
(coin) =>
coin.ticker.toLowerCase() ==
currency.ticker.toLowerCase() &&
currency.fuzzyNet == coin.ticker.toLowerCase(),
)
.isNotEmpty,
)
.toList();
final walletCoins = results
.where(
(currency) => AppConfig.coins
.where(
(coin) =>
coin.ticker.toLowerCase() ==
currency.ticker.toLowerCase() &&
currency.fuzzyNet == coin.ticker.toLowerCase(),
)
.isNotEmpty,
)
.toList();

final list = results.toList();

Expand Down Expand Up @@ -240,8 +234,9 @@ class _ExchangeCurrencySelectionViewState
builder: (child) {
return Background(
child: Scaffold(
backgroundColor:
Theme.of(context).extension<StackColors>()!.background,
backgroundColor: Theme.of(
context,
).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
Expand Down Expand Up @@ -286,45 +281,45 @@ class _ExchangeCurrencySelectionViewState
focusNode: _searchFocusNode,
onChanged: (value) => setState(() => _searchString = value),
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Search",
_searchFocusNode,
context,
desktopMed: isDesktop,
).copyWith(
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 16,
),
child: SvgPicture.asset(
Assets.svg.search,
width: 16,
height: 16,
),
),
suffixIcon:
_searchController.text.isNotEmpty
decoration:
standardInputDecoration(
"Search",
_searchFocusNode,
context,
desktopMed: isDesktop,
).copyWith(
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 16,
),
child: SvgPicture.asset(
Assets.svg.search,
width: 16,
height: 16,
),
),
suffixIcon: _searchController.text.isNotEmpty
? Padding(
padding: const EdgeInsets.only(right: 0),
child: UnconstrainedBox(
child: Row(
children: [
TextFieldIconButton(
child: const XIcon(),
onTap: () async {
setState(() {
_searchController.text = "";
_searchString = "";
});
},
),
],
padding: const EdgeInsets.only(right: 0),
child: UnconstrainedBox(
child: Row(
children: [
TextFieldIconButton(
child: const XIcon(),
onTap: () async {
setState(() {
_searchController.text = "";
_searchString = "";
});
},
),
],
),
),
),
)
)
: null,
),
),
),
),
const SizedBox(height: 20),
Expand Down Expand Up @@ -358,23 +353,20 @@ class _ExchangeCurrencySelectionViewState
height: 24,
child:
AppConfig.isStackCoin(
items[index].ticker,
)
? CoinIconForTicker(
ticker: items[index].ticker,
size: 24,
)
: hasImageUrl
? _NetImage(
url: image,
key: ValueKey(
image + items[index].fuzzyNet,
),
)
: const SizedBox(
width: 24,
height: 24,
items[index].ticker,
)
? CoinIconForTicker(
ticker: items[index].ticker,
size: 24,
)
: hasImageUrl
? _NetImage(
url: image,
key: ValueKey(
image + items[index].fuzzyNet,
),
)
: const SizedBox(width: 24, height: 24),
),
const SizedBox(width: 10),
Expanded(
Expand All @@ -399,24 +391,21 @@ class _ExchangeCurrencySelectionViewState
left: 12,
),
child: CoinTickerTag(
ticker:
items[index].fuzzyNet
.toUpperCase(),
ticker: items[index].fuzzyNet
.toUpperCase(),
),
),
],
),
const SizedBox(height: 2),
Text(
items[index].ticker.toUpperCase(),
style: STextStyles.smallMed12(
context,
).copyWith(
color:
Theme.of(context)
style: STextStyles.smallMed12(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
),
),
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/exchange_view/exchange_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
child: Container(
color: Theme.of(
context,
).extension<StackColors>()!.overlay.withOpacity(0.6),
).extension<StackColors>()!.overlay.withValues(alpha: 0.6),
child: const CustomLoadingOverlay(
message: "Updating exchange rate",
eventBus: null,
Expand Down
Loading
Loading