copy and favorited star icon color fix

This commit is contained in:
julian 2022-09-22 08:45:24 -06:00
parent 41527d895b
commit 2edc0c1102
8 changed files with 27 additions and 11 deletions

View file

@ -127,8 +127,8 @@ class _AddAddressBookEntryViewState
icon: SvgPicture.asset(
Assets.svg.star,
color: _isFavorite
? StackTheme.instance.color.accentColorRed
: StackTheme.instance.color.buttonBackSecondary,
? StackTheme.instance.color.favoriteStarActive
: StackTheme.instance.color.favoriteStarInactive,
width: 20,
height: 20,
),

View file

@ -133,8 +133,8 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
icon: SvgPicture.asset(
Assets.svg.star,
color: _contact.isFavorite
? StackTheme.instance.color.infoItemIcons
: StackTheme.instance.color.buttonBackSecondary,
? StackTheme.instance.color.favoriteStarActive
: StackTheme.instance.color.favoriteStarInactive,
width: 20,
height: 20,
),

View file

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
@ -57,16 +59,17 @@ class WalletBackupView extends ConsumerWidget {
Assets.svg.copy,
width: 20,
height: 20,
color: StackTheme.instance.color.topNavIconPrimary,
),
onPressed: () async {
await clipboardInterface
.setData(ClipboardData(text: mnemonic.join(" ")));
showFloatingFlushBar(
unawaited(showFloatingFlushBar(
type: FlushBarType.info,
message: "Copied to clipboard",
iconAsset: Assets.svg.copy,
context: context,
);
));
},
),
),

View file

@ -163,6 +163,9 @@ abstract class StackColorTheme {
Color get stackWalletMid;
Color get stackWalletBottom;
Color get bottomNavShadow;
Color get favoriteStarActive;
Color get favoriteStarInactive;
}
class CoinThemeColor {

View file

@ -284,4 +284,9 @@ class DarkColors extends StackColorTheme {
Color get stackWalletBottom => const Color(0xFFFFFFFF);
@override
Color get bottomNavShadow => const Color(0xFF282E33);
@override
Color get favoriteStarActive => accentColorYellow;
@override
Color get favoriteStarInactive => textSubtitle2;
}

View file

@ -284,4 +284,9 @@ class LightColors extends StackColorTheme {
Color get stackWalletBottom => const Color(0xFF232323);
@override
Color get bottomNavShadow => const Color(0xFF282E33);
@override
Color get favoriteStarActive => infoItemIcons;
@override
Color get favoriteStarInactive => textSubtitle3;
}

View file

@ -35,8 +35,8 @@ class _FavoriteToggleState extends State<FavoriteToggle> {
@override
void initState() {
on = widget.on ?? StackTheme.instance.color.infoItemIcons;
off = widget.off ?? StackTheme.instance.color.buttonBackSecondary;
on = widget.on ?? StackTheme.instance.color.favoriteStarActive;
off = widget.off ?? StackTheme.instance.color.favoriteStarInactive;
_isActive = widget.initialState;
_color = _isActive ? on : off;
_onChanged = widget.onChanged;

View file

@ -33,20 +33,20 @@ class _ManagedFavoriteCardState extends ConsumerState<ManagedFavorite> {
return RoundedWhiteContainer(
padding: const EdgeInsets.all(4.0),
child: RawMaterialButton(
onPressed: () async {
onPressed: () {
final provider = ref
.read(walletsChangeNotifierProvider)
.getManagerProvider(manager.walletId);
if (!manager.isFavorite) {
ref.read(favoritesProvider).add(provider, true);
ref.read(nonFavoritesProvider).remove(provider, true);
await ref
ref
.read(walletsServiceChangeNotifierProvider)
.addFavorite(manager.walletId);
} else {
ref.read(favoritesProvider).remove(provider, true);
ref.read(nonFavoritesProvider).add(provider, true);
await ref
ref
.read(walletsServiceChangeNotifierProvider)
.removeFavorite(manager.walletId);
}