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
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ class AppearanceSettingsView extends ConsumerWidget {
child: Consumer(
builder: (_, ref, __) {
return RawMaterialButton(
splashColor:
Theme.of(
context,
).extension<StackColors>()!.highlight,
splashColor: Theme.of(
context,
).extension<StackColors>()!.highlight,
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
Expand Down Expand Up @@ -91,17 +90,78 @@ class AppearanceSettingsView extends ConsumerWidget {
width: 40,
child: DraggableSwitchButton(
isOn: ref.watch(
prefsChangeNotifierProvider.select(
(value) =>
value.showFavoriteWallets,
),
prefsChangeNotifierProvider
.select(
(value) => value
.showFavoriteWallets,
),
),
onValueChanged: (newValue) {
ref
.read(
prefsChangeNotifierProvider,
)
.showFavoriteWallets = newValue;
.read(
prefsChangeNotifierProvider,
)
.showFavoriteWallets =
newValue;
},
),
),
],
),
),
);
},
),
),
const SizedBox(height: 10),
RoundedWhiteContainer(
child: Consumer(
builder: (_, ref, __) {
return RawMaterialButton(
splashColor: Theme.of(
context,
).extension<StackColors>()!.highlight,
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
),
onPressed: null,
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 8,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
"Hide balances",
style: STextStyles.titleBold12(
context,
),
textAlign: TextAlign.left,
),
SizedBox(
height: 20,
width: 40,
child: DraggableSwitchButton(
isOn: ref.watch(
prefsChangeNotifierProvider
.select(
(value) =>
value.hideBalances,
),
),
onValueChanged: (newValue) {
ref
.read(
prefsChangeNotifierProvider,
)
.hideBalances =
newValue;
},
),
),
Expand Down
66 changes: 41 additions & 25 deletions lib/pages/token_view/sub_widgets/my_token_select_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import '../../../wallets/wallet/impl/sub_wallets/eth_token_wallet.dart';
import '../../../wallets/wallet/wallet.dart';
import '../../../widgets/desktop/primary_button.dart';
import '../../../widgets/dialogs/basic_dialog.dart';
import '../../../widgets/hideable_balance.dart';
import '../../../widgets/icon_widgets/eth_token_icon.dart';
import '../../../widgets/rounded_white_container.dart';
import '../token_view.dart';
Expand Down Expand Up @@ -189,33 +190,48 @@ class _MyTokenSelectItemState extends ConsumerState<MyTokenSelectItem> {
: STextStyles.titleBold12(context),
),
const Spacer(),
Text(
ref
.watch(
pAmountFormatter(
Ethereum(CryptoCurrencyNetwork.main),
),
)
.format(
ref
.watch(
pTokenBalance((
walletId: widget.walletId,
contractAddress: widget.token.address,
)),
)
.total,
tokenContract: widget.token,
),
style: isDesktop
? STextStyles.desktopTextExtraSmall(
HideableBalance(
key: ValueKey(
"hideBalance_${widget.walletId}_"
"${widget.token.address}",
),
iconColor: isDesktop
? Theme.of(
context,
).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.textDark,
).extension<StackColors>()!.textDark
: Theme.of(
context,
).extension<StackColors>()!.infoItemLabel,
iconSize: 16,
child: Text(
ref
.watch(
pAmountFormatter(
Ethereum(CryptoCurrencyNetwork.main),
),
)
: STextStyles.itemSubtitle(context),
.format(
ref
.watch(
pTokenBalance((
walletId: widget.walletId,
contractAddress:
widget.token.address,
)),
)
.total,
tokenContract: widget.token,
),
style: isDesktop
? STextStyles.desktopTextExtraSmall(
context,
).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.textDark,
)
: STextStyles.itemSubtitle(context),
),
),
],
),
Expand Down
49 changes: 31 additions & 18 deletions lib/pages/token_view/sub_widgets/token_summary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import '../../../wallets/isar/providers/eth/token_balance_provider.dart';
import '../../../wallets/isar/providers/wallet_info_provider.dart';
import '../../../widgets/coin_ticker_tag.dart';
import '../../../widgets/conditional_parent.dart';
import '../../../widgets/hideable_balance.dart';
import '../../../widgets/rounded_container.dart';
import '../../buy_view/buy_in_wallet_view.dart';
import '../../exchange_view/wallet_initiated_exchange_view.dart';
Expand Down Expand Up @@ -104,18 +105,24 @@ class TokenSummary extends ConsumerWidget {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
ref
.watch(
pAmountFormatter(
Ethereum(CryptoCurrencyNetwork.main),
),
)
.format(balance.total, tokenContract: token),
style: STextStyles.pageTitleH1(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.tokenSummaryTextPrimary,
HideableBalance(
iconColor: Theme.of(
context,
).extension<StackColors>()!.tokenSummaryTextPrimary,
iconSize: 24,
child: Text(
ref
.watch(
pAmountFormatter(
Ethereum(CryptoCurrencyNetwork.main),
),
)
.format(balance.total, tokenContract: token),
style: STextStyles.pageTitleH1(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.tokenSummaryTextPrimary,
),
),
),
const SizedBox(width: 10),
Expand All @@ -128,12 +135,18 @@ class TokenSummary extends ConsumerWidget {
),
if (price != null) const SizedBox(height: 6),
if (price != null)
Text(
"${(balance.total.decimal * price).toAmount(fractionDigits: 2).fiatString(locale: ref.watch(localeServiceChangeNotifierProvider.select((value) => value.locale)))} ${ref.watch(prefsChangeNotifierProvider.select((value) => value.currency))}",
style: STextStyles.subtitle500(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.tokenSummaryTextPrimary,
HideableBalance(
iconColor: Theme.of(
context,
).extension<StackColors>()!.tokenSummaryTextPrimary,
iconSize: 16,
child: Text(
"${(balance.total.decimal * price).toAmount(fractionDigits: 2).fiatString(locale: ref.watch(localeServiceChangeNotifierProvider.select((value) => value.locale)))} ${ref.watch(prefsChangeNotifierProvider.select((value) => value.currency))}",
style: STextStyles.subtitle500(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.tokenSummaryTextPrimary,
),
),
),
const SizedBox(height: 20),
Expand Down
Loading
Loading