hide price values on favorite card when incognito mode enabled

This commit is contained in:
julian 2022-10-17 15:56:03 -06:00
parent 23c2b2f50f
commit cfc8f2ab9d

View file

@ -49,6 +49,8 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
@override
Widget build(BuildContext context) {
final coin = ref.watch(managerProvider.select((value) => value.coin));
final externalCalls = ref.watch(
prefsChangeNotifierProvider.select((value) => value.externalCalls));
return GestureDetector(
onTap: () {
@ -70,7 +72,9 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
width: widget.width,
height: widget.height,
decoration: BoxDecoration(
color: Theme.of(context).extension<StackColors>()!.colorForCoin(coin),
color: Theme.of(context)
.extension<StackColors>()!
.colorForCoin(coin),
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -138,7 +142,9 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
ref.watch(managerProvider
.select((value) => value.walletName)),
style: STextStyles.itemSubtitle12(context).copyWith(
color: Theme.of(context).extension<StackColors>()!.textFavoriteCard,
color: Theme.of(context)
.extension<StackColors>()!
.textFavoriteCard,
),
overflow: TextOverflow.fade,
),
@ -159,6 +165,7 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
snapshot.hasData) {
if (snapshot.data != null) {
_cachedBalance = snapshot.data!;
if (externalCalls) {
_cachedFiatValue = _cachedBalance *
ref
.watch(
@ -169,6 +176,7 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
.item1;
}
}
}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -185,13 +193,17 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
)} ${coin.ticker}",
style: STextStyles.titleBold12(context).copyWith(
fontSize: 16,
color: Theme.of(context).extension<StackColors>()!.textFavoriteCard,
color: Theme.of(context)
.extension<StackColors>()!
.textFavoriteCard,
),
),
),
if (externalCalls)
const SizedBox(
height: 4,
),
if (externalCalls)
Text(
"${Format.localizedStringAsFixed(
decimalPlaces: 2,
@ -206,7 +218,9 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
)}",
style: STextStyles.itemSubtitle12(context).copyWith(
fontSize: 10,
color: Theme.of(context).extension<StackColors>()!.textFavoriteCard,
color: Theme.of(context)
.extension<StackColors>()!
.textFavoriteCard,
),
),
],