Merge branch 'desktop' into testing

This commit is contained in:
julian 2022-09-22 17:50:09 -06:00
commit 4c25c67d89
180 changed files with 4982 additions and 2405 deletions
lib
main.dart
notifications
pages
add_wallet_views
address_book_views
buy_view
exchange_view
home_view
intro_view.dartloading_view.dart
manage_favorites_view
notification_views
pinpad_views
receive_view
send_view
settings_views/global_settings_view

View file

@ -42,6 +42,7 @@ import 'package:stackwallet/providers/global/base_currencies_provider.dart';
// import 'package:stackwallet/providers/global/has_authenticated_start_state_provider.dart';
import 'package:stackwallet/providers/global/trades_service_provider.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
import 'package:stackwallet/route_generator.dart';
import 'package:stackwallet/services/debug_service.dart';
import 'package:stackwallet/services/locale_service.dart';
@ -50,14 +51,16 @@ import 'package:stackwallet/services/notifications_api.dart';
import 'package:stackwallet/services/notifications_service.dart';
import 'package:stackwallet/services/trade_service.dart';
import 'package:stackwallet/services/wallets.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/db_version_migration.dart';
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/prefs.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/dark_colors.dart';
import 'package:stackwallet/utilities/theme/light_colors.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:window_size/window_size.dart';
@ -147,11 +150,11 @@ void main() async {
switch (colorScheme) {
case "dark":
StackTheme.instance.setTheme(ThemeType.dark);
Assets.theme = ThemeType.dark;
break;
case "light":
default:
StackTheme.instance.setTheme(ThemeType.light);
Assets.theme = ThemeType.light;
}
// SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
@ -367,8 +370,12 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
_prefs = ref.read(prefsChangeNotifierProvider);
_wallets = ref.read(walletsChangeNotifierProvider);
if (Platform.isAndroid) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
WidgetsBinding.instance.addPostFrameCallback((_) async {
ref.read(colorThemeProvider.state).state =
StackColors.fromStackColorTheme(
Assets.theme! == ThemeType.dark ? DarkColors() : LightColors());
if (Platform.isAndroid) {
// fetch open file if it exists
await getOpenFile();
@ -382,8 +389,8 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
ref.read(openedFromSWBFileStringStateProvider.state).state = null;
}
// ref.read(shouldShowLockscreenOnResumeStateProvider.state).state = false;
});
}
}
});
super.initState();
}
@ -515,23 +522,25 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
// addToDebugMessagesDB: false);
// });
final colorScheme = ref.watch(colorThemeProvider.state).state;
return MaterialApp(
key: GlobalKey(),
navigatorKey: navigatorKey,
title: 'Stack Wallet',
onGenerateRoute: RouteGenerator.generateRoute,
theme: ThemeData(
highlightColor: StackTheme.instance.color.highlight,
extensions: [colorScheme],
highlightColor: colorScheme.highlight,
brightness: Brightness.light,
fontFamily: GoogleFonts.inter().fontFamily,
unselectedWidgetColor:
StackTheme.instance.color.radioButtonBorderDisabled,
textTheme: GoogleFonts.interTextTheme().copyWith(
button: STextStyles.button,
subtitle1: STextStyles.field.copyWith(
color: StackTheme.instance.color.textDark,
),
),
unselectedWidgetColor: colorScheme.radioButtonBorderDisabled,
// textTheme: GoogleFonts.interTextTheme().copyWith(
// button: STextStyles.button(context),
// subtitle1: STextStyles.field(context).copyWith(
// color: colorScheme.textDark,
// ),
// ),
radioTheme: const RadioThemeData(
splashRadius: 0,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
@ -539,19 +548,19 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
// splashFactory: NoSplash.splashFactory,
splashColor: Colors.transparent,
buttonTheme: ButtonThemeData(
splashColor: StackTheme.instance.color.splash,
splashColor: colorScheme.splash,
),
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(
// splashFactory: NoSplash.splashFactory,
overlayColor:
MaterialStateProperty.all(StackTheme.instance.color.splash),
overlayColor: MaterialStateProperty.all(colorScheme.splash),
minimumSize: MaterialStateProperty.all<Size>(const Size(46, 46)),
textStyle: MaterialStateProperty.all<TextStyle>(STextStyles.button),
foregroundColor: MaterialStateProperty.all(
StackTheme.instance.color.buttonTextSecondary),
// textStyle: MaterialStateProperty.all<TextStyle>(
// STextStyles.button(context)),
foregroundColor:
MaterialStateProperty.all(colorScheme.buttonTextSecondary),
backgroundColor: MaterialStateProperty.all<Color>(
StackTheme.instance.color.buttonBackSecondary),
colorScheme.buttonBackSecondary),
shape: MaterialStateProperty.all<OutlinedBorder>(
RoundedRectangleBorder(
// 1000 to be relatively sure it keeps its pill shape
@ -560,9 +569,8 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
),
),
),
primaryColor: StackTheme.instance.color.accentColorDark,
primarySwatch:
Util.createMaterialColor(StackTheme.instance.color.accentColorDark),
primaryColor: colorScheme.accentColorDark,
primarySwatch: Util.createMaterialColor(colorScheme.accentColorDark),
checkboxTheme: CheckboxThemeData(
splashRadius: 0,
shape: RoundedRectangleBorder(
@ -572,45 +580,44 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
checkColor: MaterialStateColor.resolveWith(
(state) {
if (state.contains(MaterialState.selected)) {
return StackTheme.instance.color.checkboxIconChecked;
return colorScheme.checkboxIconChecked;
}
return StackTheme.instance.color.checkboxBGChecked;
return colorScheme.checkboxBGChecked;
},
),
fillColor: MaterialStateColor.resolveWith(
(states) {
if (states.contains(MaterialState.selected)) {
return StackTheme.instance.color.checkboxBGChecked;
return colorScheme.checkboxBGChecked;
}
return StackTheme.instance.color.checkboxBorderEmpty;
return colorScheme.checkboxBorderEmpty;
},
),
),
appBarTheme: AppBarTheme(
centerTitle: false,
color: StackTheme.instance.color.background,
color: colorScheme.background,
elevation: 0,
),
inputDecorationTheme: InputDecorationTheme(
focusColor: StackTheme.instance.color.textFieldDefaultBG,
fillColor: StackTheme.instance.color.textFieldDefaultBG,
focusColor: colorScheme.textFieldDefaultBG,
fillColor: colorScheme.textFieldDefaultBG,
filled: true,
contentPadding: const EdgeInsets.symmetric(
vertical: 6,
horizontal: 12,
),
labelStyle: STextStyles.fieldLabel,
hintStyle: STextStyles.fieldLabel,
enabledBorder: _buildOutlineInputBorder(
StackTheme.instance.color.textFieldDefaultBG),
focusedBorder: _buildOutlineInputBorder(
StackTheme.instance.color.textFieldDefaultBG),
errorBorder: _buildOutlineInputBorder(
StackTheme.instance.color.textFieldDefaultBG),
disabledBorder: _buildOutlineInputBorder(
StackTheme.instance.color.textFieldDefaultBG),
focusedErrorBorder: _buildOutlineInputBorder(
StackTheme.instance.color.textFieldDefaultBG),
// labelStyle: STextStyles.fieldLabel(context),
// hintStyle: STextStyles.fieldLabel(context),
enabledBorder:
_buildOutlineInputBorder(colorScheme.textFieldDefaultBG),
focusedBorder:
_buildOutlineInputBorder(colorScheme.textFieldDefaultBG),
errorBorder: _buildOutlineInputBorder(colorScheme.textFieldDefaultBG),
disabledBorder:
_buildOutlineInputBorder(colorScheme.textFieldDefaultBG),
focusedErrorBorder:
_buildOutlineInputBorder(colorScheme.textFieldDefaultBG),
),
),
home: FutureBuilder(

View file

@ -3,7 +3,7 @@ import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/models/notification_model.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -42,7 +42,9 @@ class NotificationCard extends StatelessWidget {
),
child: SvgPicture.asset(
notification.iconAssetName,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 24,
height: 24,
),
@ -56,7 +58,7 @@ class NotificationCard extends StatelessWidget {
children: [
Text(
notification.title,
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 2,
@ -66,11 +68,11 @@ class NotificationCard extends StatelessWidget {
children: [
Text(
notification.description,
style: STextStyles.label,
style: STextStyles.label(context),
),
Text(
extractPrettyDateString(notification.date),
style: STextStyles.label,
style: STextStyles.label(context),
),
],
),
@ -83,7 +85,10 @@ class NotificationCard extends StatelessWidget {
if (notification.read)
Positioned.fill(
child: RoundedContainer(
color: StackTheme.instance.color.background.withOpacity(0.5),
color: Theme.of(context)
.extension<StackColors>()!
.background
.withOpacity(0.5),
),
),
],

View file

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
Future<dynamic> showFloatingFlushBar({
required FlushBarType type,
@ -19,16 +19,16 @@ Future<dynamic> showFloatingFlushBar({
Color fg;
switch (type) {
case FlushBarType.success:
fg = StackTheme.instance.color.snackBarTextSuccess;
bg = StackTheme.instance.color.snackBarBackSuccess;
fg = Theme.of(context).extension<StackColors>()!.snackBarTextSuccess;
bg = Theme.of(context).extension<StackColors>()!.snackBarBackSuccess;
break;
case FlushBarType.info:
fg = StackTheme.instance.color.snackBarTextInfo;
bg = StackTheme.instance.color.snackBarBackInfo;
fg = Theme.of(context).extension<StackColors>()!.snackBarTextInfo;
bg = Theme.of(context).extension<StackColors>()!.snackBarBackInfo;
break;
case FlushBarType.warning:
fg = StackTheme.instance.color.snackBarTextError;
bg = StackTheme.instance.color.snackBarBackError;
fg = Theme.of(context).extension<StackColors>()!.snackBarTextError;
bg = Theme.of(context).extension<StackColors>()!.snackBarBackError;
break;
}
final bar = Flushbar<dynamic>(

View file

@ -9,7 +9,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
@ -97,12 +97,14 @@ class _AddWalletViewState extends State<AddWalletView> {
_searchTerm = value;
});
},
style: STextStyles.desktopTextMedium.copyWith(
style:
STextStyles.desktopTextMedium(context).copyWith(
height: 2,
),
decoration: standardInputDecoration(
"Search",
_searchFocusNode,
context,
).copyWith(
contentPadding: const EdgeInsets.symmetric(
vertical: 10,
@ -116,7 +118,8 @@ class _AddWalletViewState extends State<AddWalletView> {
Assets.svg.search,
width: 24,
height: 24,
color: StackTheme.instance.color
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultSearchIconLeft,
),
),
@ -186,7 +189,7 @@ class _AddWalletViewState extends State<AddWalletView> {
),
),
body: Container(
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(

View file

@ -14,7 +14,9 @@ class AddWalletText extends StatelessWidget {
Text(
"Add wallet",
textAlign: TextAlign.center,
style: isDesktop ? STextStyles.desktopH2 : STextStyles.pageTitleH1,
style: isDesktop
? STextStyles.desktopH2(context)
: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 16,
@ -22,8 +24,9 @@ class AddWalletText extends StatelessWidget {
Text(
"Select wallet currency",
textAlign: TextAlign.center,
style:
isDesktop ? STextStyles.desktopSubtitleH2 : STextStyles.subtitle,
style: isDesktop
? STextStyles.desktopSubtitleH2(context)
: STextStyles.subtitle(context),
),
],
);

View file

@ -6,7 +6,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
class CoinSelectItem extends ConsumerWidget {
@ -28,13 +28,13 @@ class CoinSelectItem extends ConsumerWidget {
decoration: BoxDecoration(
// color: selectedCoin == coin ? CFColors.selection : CFColors.white,
color: selectedCoin == coin
? StackTheme.instance.color.textFieldActiveBG
: StackTheme.instance.color.popupBG,
? Theme.of(context).extension<StackColors>()!.textFieldActiveBG
: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius:
BorderRadius.circular(Constants.size.circularBorderRadius),
),
child: MaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
key: Key("coinSelectItemButtonKey_${coin.name}"),
padding: isDesktop
? const EdgeInsets.only(left: 24)
@ -61,8 +61,8 @@ class CoinSelectItem extends ConsumerWidget {
Text(
coin.prettyName,
style: isDesktop
? STextStyles.desktopTextMedium
: STextStyles.subtitle.copyWith(
? STextStyles.desktopTextMedium(context)
: STextStyles.subtitle(context).copyWith(
fontWeight: FontWeight.w600,
fontSize: 14,
),
@ -78,7 +78,9 @@ class CoinSelectItem extends ConsumerWidget {
height: 24,
child: SvgPicture.asset(
Assets.svg.check,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
),
),

View file

@ -3,7 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class AddWalletNextButton extends ConsumerWidget {
const AddWalletNextButton({
@ -34,15 +34,19 @@ class AddWalletNextButton extends ConsumerWidget {
);
},
style: enabled
? StackTheme.instance.getPrimaryEnabledButtonColor(context)
: StackTheme.instance.getPrimaryDisabledButtonColor(context),
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
child: Text(
"Next",
style: isDesktop
? enabled
? STextStyles.desktopButtonEnabled
: STextStyles.desktopButtonDisabled
: STextStyles.button,
? STextStyles.desktopButtonEnabled(context)
: STextStyles.desktopButtonDisabled(context)
: STextStyles.button(context),
),
);
}

View file

@ -5,7 +5,7 @@ import 'package:stackwallet/pages/add_wallet_views/create_or_restore_wallet_view
import 'package:stackwallet/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart';
import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my_stack_button.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
@ -81,7 +81,7 @@ class CreateOrRestoreWalletView extends StatelessWidget {
),
),
body: Container(
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(

View file

@ -14,7 +14,9 @@ class CreateRestoreWalletSubTitle extends StatelessWidget {
return Text(
"Create a new wallet or restore an existing wallet from seed.",
textAlign: TextAlign.center,
style: isDesktop ? STextStyles.desktopSubtitleH2 : STextStyles.subtitle,
style: isDesktop
? STextStyles.desktopSubtitleH2(context)
: STextStyles.subtitle(context),
);
}
}

View file

@ -17,7 +17,9 @@ class CreateRestoreWalletTitle extends StatelessWidget {
return Text(
"Add ${coin.prettyName} wallet",
textAlign: TextAlign.center,
style: isDesktop ? STextStyles.desktopH2 : STextStyles.pageTitleH1,
style: isDesktop
? STextStyles.desktopH2(context)
: STextStyles.pageTitleH1(context),
);
}
}

View file

@ -3,7 +3,7 @@ import 'package:stackwallet/pages/add_wallet_views/name_your_wallet_view/name_yo
import 'package:stackwallet/utilities/enums/add_wallet_type_enum.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:tuple/tuple.dart';
class CreateWalletButtonGroup extends StatelessWidget {
@ -28,7 +28,9 @@ class CreateWalletButtonGroup extends StatelessWidget {
minWidth: isDesktop ? 480 : 0,
),
child: TextButton(
style: StackTheme.instance.getPrimaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: () {
Navigator.of(context).pushNamed(
NameYourWalletView.routeName,
@ -41,8 +43,8 @@ class CreateWalletButtonGroup extends StatelessWidget {
child: Text(
"Create new wallet",
style: isDesktop
? STextStyles.desktopButtonEnabled
: STextStyles.button,
? STextStyles.desktopButtonEnabled(context)
: STextStyles.button(context),
),
),
),
@ -55,7 +57,9 @@ class CreateWalletButtonGroup extends StatelessWidget {
minWidth: isDesktop ? 480 : 0,
),
child: TextButton(
style: StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
onPressed: () {
Navigator.of(context).pushNamed(
NameYourWalletView.routeName,
@ -68,9 +72,11 @@ class CreateWalletButtonGroup extends StatelessWidget {
child: Text(
"Restore wallet",
style: isDesktop
? STextStyles.desktopButtonSecondaryEnabled
: STextStyles.button.copyWith(
color: StackTheme.instance.color.accentColorDark),
? STextStyles.desktopButtonSecondaryEnabled(context)
: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
),

View file

@ -9,14 +9,13 @@ import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my
import 'package:stackwallet/providers/global/wallets_service_provider.dart';
import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/add_wallet_type_enum.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/name_generator.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
@ -126,7 +125,7 @@ class _NameYourWalletViewState extends ConsumerState<NameYourWalletView> {
),
),
body: Container(
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
child: Padding(
padding: const EdgeInsets.all(16),
child: LayoutBuilder(
@ -169,7 +168,9 @@ class _NameYourWalletViewState extends ConsumerState<NameYourWalletView> {
Text(
"Name your ${coin.prettyName} wallet",
textAlign: TextAlign.center,
style: isDesktop ? STextStyles.desktopH2 : STextStyles.pageTitleH1,
style: isDesktop
? STextStyles.desktopH2(context)
: STextStyles.pageTitleH1(context),
),
SizedBox(
height: isDesktop ? 16 : 8,
@ -178,8 +179,8 @@ class _NameYourWalletViewState extends ConsumerState<NameYourWalletView> {
"Enter a label for your wallet (e.g. Savings)",
textAlign: TextAlign.center,
style: isDesktop
? STextStyles.desktopSubtitleH2
: STextStyles.subtitle,
? STextStyles.desktopSubtitleH2(context)
: STextStyles.subtitle(context),
),
SizedBox(
height: isDesktop ? 40 : 16,
@ -209,13 +210,14 @@ class _NameYourWalletViewState extends ConsumerState<NameYourWalletView> {
focusNode: textFieldFocusNode,
controller: textEditingController,
style: isDesktop
? STextStyles.desktopTextMedium.copyWith(
? STextStyles.desktopTextMedium(context).copyWith(
height: 2,
)
: STextStyles.field,
: STextStyles.field(context),
decoration: standardInputDecoration(
"Enter wallet name",
textFieldFocusNode,
context,
).copyWith(
suffixIcon: Padding(
padding: EdgeInsets.only(right: isDesktop ? 6 : 0),
@ -265,10 +267,12 @@ class _NameYourWalletViewState extends ConsumerState<NameYourWalletView> {
child: Text(
"Roll the dice to pick a random name.",
style: isDesktop
? STextStyles.desktopTextExtraSmall.copyWith(
color: StackTheme.instance.color.textSubtitle1,
? STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
)
: STextStyles.itemSubtitle,
: STextStyles.itemSubtitle(context),
),
),
),
@ -338,15 +342,19 @@ class _NameYourWalletViewState extends ConsumerState<NameYourWalletView> {
}
: null,
style: _nextEnabled
? StackTheme.instance.getPrimaryEnabledButtonColor(context)
: StackTheme.instance.getPrimaryDisabledButtonColor(context),
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
child: Text(
"Next",
style: isDesktop
? _nextEnabled
? STextStyles.desktopButtonEnabled
: STextStyles.desktopButtonDisabled
: STextStyles.button,
? STextStyles.desktopButtonEnabled(context)
: STextStyles.desktopButtonDisabled(context)
: STextStyles.button(context),
),
),
),

View file

@ -14,12 +14,11 @@ import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/manager.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
@ -142,13 +141,17 @@ class _NewWalletRecoveryPhraseViewState
child: AspectRatio(
aspectRatio: 1,
child: AppBarIconButton(
color: StackTheme.instance.color.background,
color: Theme.of(context)
.extension<StackColors>()!
.background,
shadows: const [],
icon: SvgPicture.asset(
Assets.svg.copy,
width: 24,
height: 24,
color: StackTheme.instance.color.topNavIconPrimary,
color: Theme.of(context)
.extension<StackColors>()!
.topNavIconPrimary,
),
onPressed: () async {
await _copy();
@ -159,7 +162,7 @@ class _NewWalletRecoveryPhraseViewState
],
),
body: Container(
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
width: isDesktop ? 600 : null,
child: Padding(
padding: isDesktop
@ -176,7 +179,7 @@ class _NewWalletRecoveryPhraseViewState
Text(
_manager.walletName,
textAlign: TextAlign.center,
style: STextStyles.label.copyWith(
style: STextStyles.label(context).copyWith(
fontSize: 12,
),
),
@ -187,8 +190,8 @@ class _NewWalletRecoveryPhraseViewState
"Recovery Phrase",
textAlign: TextAlign.center,
style: isDesktop
? STextStyles.desktopH2
: STextStyles.pageTitleH1,
? STextStyles.desktopH2(context)
: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 16,
@ -196,8 +199,10 @@ class _NewWalletRecoveryPhraseViewState
Container(
decoration: BoxDecoration(
color: isDesktop
? StackTheme.instance.color.background
: StackTheme.instance.color.popupBG,
? Theme.of(context)
.extension<StackColors>()!
.background
: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius),
),
@ -209,10 +214,11 @@ class _NewWalletRecoveryPhraseViewState
"Please write down your recovery phrase in the correct order and save it to keep your funds secure. You will also be asked to verify the words on the next screen.",
textAlign: TextAlign.center,
style: isDesktop
? STextStyles.desktopSubtitleH2
: STextStyles.label.copyWith(
color:
StackTheme.instance.color.accentColorDark),
? STextStyles.desktopSubtitleH2(context)
: STextStyles.label(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
),
@ -256,7 +262,8 @@ class _NewWalletRecoveryPhraseViewState
),
Text(
"Copy to clipboard",
style: STextStyles.desktopButtonSecondaryEnabled,
style: STextStyles.desktopButtonSecondaryEnabled(
context),
)
],
),
@ -286,13 +293,14 @@ class _NewWalletRecoveryPhraseViewState
arguments: Tuple2(_manager, _mnemonic),
));
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"I saved my recovery phrase",
style: isDesktop
? STextStyles.desktopButtonEnabled
: STextStyles.button,
? STextStyles.desktopButtonEnabled(context)
: STextStyles.button(context),
),
),
),

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
class MnemonicTableItem extends StatelessWidget {
@ -28,11 +28,15 @@ class MnemonicTableItem extends StatelessWidget {
Text(
number.toString(),
style: isDesktop
? STextStyles.desktopTextExtraSmall.copyWith(
color: StackTheme.instance.color.textSubtitle2,
? STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle2,
)
: STextStyles.baseXS.copyWith(
color: StackTheme.instance.color.textSubtitle2,
: STextStyles.baseXS(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle2,
fontSize: 10,
),
),
@ -42,10 +46,10 @@ class MnemonicTableItem extends StatelessWidget {
Text(
word,
style: isDesktop
? STextStyles.desktopTextExtraSmall.copyWith(
color: StackTheme.instance.color.textDark,
? STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context).extension<StackColors>()!.textDark,
)
: STextStyles.baseXS,
: STextStyles.baseXS(context),
),
],
),

View file

@ -13,7 +13,7 @@ import 'package:stackwallet/utilities/default_nodes.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
@ -86,7 +86,7 @@ class _NewWalletRecoveryPhraseWarningViewState
Text(
walletName,
textAlign: TextAlign.center,
style: STextStyles.label.copyWith(
style: STextStyles.label(context).copyWith(
fontSize: 12,
),
),
@ -96,8 +96,9 @@ class _NewWalletRecoveryPhraseWarningViewState
Text(
"Recovery Phrase",
textAlign: TextAlign.center,
style:
isDesktop ? STextStyles.desktopH2 : STextStyles.pageTitleH1,
style: isDesktop
? STextStyles.desktopH2(context)
: STextStyles.pageTitleH1(context),
),
SizedBox(
height: isDesktop ? 32 : 16,
@ -110,8 +111,8 @@ class _NewWalletRecoveryPhraseWarningViewState
child: Text(
"On the next screen you will see $_numberOfPhraseWords words that make up your recovery phrase.\n\nPlease write it down. Keep it safe and never share it with anyone. Your recovery phrase is the only way you can access your funds if you forget your PIN, lose your phone, etc.\n\nStack Wallet does not keep nor is able to restore your recover phrase. Only you have access to your wallet.",
style: isDesktop
? STextStyles.desktopTextMediumRegular
: STextStyles.subtitle.copyWith(
? STextStyles.desktopTextMediumRegular(context)
: STextStyles.subtitle(context).copyWith(
fontSize: 12,
),
),
@ -161,8 +162,8 @@ class _NewWalletRecoveryPhraseWarningViewState
child: Text(
"I understand that if I lose my recovery phrase, I will not be able to access my funds.",
style: isDesktop
? STextStyles.desktopTextMedium
: STextStyles.baseXS,
? STextStyles.desktopTextMedium(context)
: STextStyles.baseXS(context),
),
),
],
@ -269,17 +270,19 @@ class _NewWalletRecoveryPhraseWarningViewState
}
: null,
style: ref.read(checkBoxStateProvider.state).state
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
child: Text(
"View recovery phrase",
style: isDesktop
? ref.read(checkBoxStateProvider.state).state
? STextStyles.desktopButtonEnabled
: STextStyles.desktopButtonDisabled
: STextStyles.button,
? STextStyles.desktopButtonEnabled(context)
: STextStyles.desktopButtonDisabled(context)
: STextStyles.button(context),
),
),
),

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class ConfirmRecoveryDialog extends StatelessWidget {
@ -20,20 +20,24 @@ class ConfirmRecoveryDialog extends StatelessWidget {
message:
"Restoring your wallet may take a while. Please do not exit this screen once the process is started.",
leftButton: TextButton(
style: StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
onPressed: () {
Navigator.of(context).pop();
},
),
rightButton: TextButton(
style: StackTheme.instance.getPrimaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Restore",
style: STextStyles.button,
style: STextStyles.button(context),
),
onPressed: () {
Navigator.of(context).pop();

View file

@ -10,13 +10,14 @@ import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_o
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart';
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart';
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart';
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
@ -50,9 +51,11 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
final bool _nextEnabled = true;
DateTime _restoreFromDate = DateTime.fromMillisecondsSinceEpoch(0);
late final Color baseColor;
@override
void initState() {
baseColor = ref.read(colorThemeProvider.state).state.textSubtitle2;
walletName = widget.walletName;
coin = widget.coin;
isDesktop = Util.isDesktop;
@ -70,43 +73,44 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
super.dispose();
}
final _datePickerTextStyleBase = GoogleFonts.inter(
color: StackTheme.instance.color.textSubtitle2,
fontSize: 12,
fontWeight: FontWeight.w400,
letterSpacing: 0.5,
);
TextStyle get _datePickerTextStyleBase => GoogleFonts.inter(
color: baseColor,
fontSize: 12,
fontWeight: FontWeight.w400,
letterSpacing: 0.5,
);
MaterialRoundedDatePickerStyle _buildDatePickerStyle() {
return MaterialRoundedDatePickerStyle(
paddingMonthHeader: const EdgeInsets.only(top: 11),
colorArrowNext: StackTheme.instance.color.textSubtitle1,
colorArrowPrevious: StackTheme.instance.color.textSubtitle1,
colorArrowNext: Theme.of(context).extension<StackColors>()!.textSubtitle1,
colorArrowPrevious:
Theme.of(context).extension<StackColors>()!.textSubtitle1,
textStyleButtonNegative: _datePickerTextStyleBase.copyWith(
fontSize: 16, fontWeight: FontWeight.w600),
textStyleButtonPositive: _datePickerTextStyleBase.copyWith(
fontSize: 16, fontWeight: FontWeight.w600),
textStyleCurrentDayOnCalendar: _datePickerTextStyleBase.copyWith(
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context).extension<StackColors>()!.accentColorDark,
),
textStyleDayHeader: _datePickerTextStyleBase.copyWith(
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context).extension<StackColors>()!.accentColorDark,
fontSize: 16,
fontWeight: FontWeight.w600,
),
textStyleDayOnCalendar: _datePickerTextStyleBase,
textStyleDayOnCalendarDisabled: _datePickerTextStyleBase.copyWith(
color: StackTheme.instance.color.textSubtitle3,
color: Theme.of(context).extension<StackColors>()!.textSubtitle3,
),
textStyleDayOnCalendarSelected: _datePickerTextStyleBase.copyWith(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context).extension<StackColors>()!.popupBG,
),
textStyleMonthYearHeader: _datePickerTextStyleBase.copyWith(
color: StackTheme.instance.color.textSubtitle1,
color: Theme.of(context).extension<StackColors>()!.textSubtitle1,
fontSize: 16,
fontWeight: FontWeight.w600,
),
textStyleYearButton: _datePickerTextStyleBase.copyWith(
color: StackTheme.instance.color.textWhite,
color: Theme.of(context).extension<StackColors>()!.textWhite,
fontSize: 16,
fontWeight: FontWeight.w600,
),
@ -117,12 +121,12 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
MaterialRoundedYearPickerStyle _buildYearPickerStyle() {
return MaterialRoundedYearPickerStyle(
textStyleYear: _datePickerTextStyleBase.copyWith(
color: StackTheme.instance.color.textSubtitle2,
color: Theme.of(context).extension<StackColors>()!.textSubtitle2,
fontWeight: FontWeight.w600,
fontSize: 16,
),
textStyleYearSelected: _datePickerTextStyleBase.copyWith(
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context).extension<StackColors>()!.accentColorDark,
fontWeight: FontWeight.w600,
fontSize: 18,
),
@ -164,8 +168,8 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
initialDate: DateTime.now(),
height: height * 0.5,
theme: ThemeData(
primarySwatch:
Util.createMaterialColor(StackTheme.instance.color.accentColorDark),
primarySwatch: Util.createMaterialColor(
Theme.of(context).extension<StackColors>()!.accentColorDark),
),
//TODO pick a better initial date
// 2007 chosen as that is just before bitcoin launched
@ -252,8 +256,9 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
Text(
"Restore options",
textAlign: TextAlign.center,
style:
isDesktop ? STextStyles.desktopH2 : STextStyles.pageTitleH1,
style: isDesktop
? STextStyles.desktopH2(context)
: STextStyles.pageTitleH1(context),
),
SizedBox(
height: isDesktop ? 40 : 24,
@ -262,10 +267,12 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
Text(
"Choose start date",
style: isDesktop
? STextStyles.desktopTextExtraSmall.copyWith(
color: StackTheme.instance.color.textDark3,
? STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
)
: STextStyles.smallMed12,
: STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
if (coin == Coin.monero || coin == Coin.epicCash)
@ -291,10 +298,12 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
child: Text(
"Choose the date you made the wallet (approximate is fine)",
style: isDesktop
? STextStyles.desktopTextExtraSmall.copyWith(
color: StackTheme.instance.color.textSubtitle1,
? STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
)
: STextStyles.smallMed12.copyWith(
: STextStyles.smallMed12(context).copyWith(
fontSize: 10,
),
),
@ -307,10 +316,12 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
Text(
"Choose recovery phrase length",
style: isDesktop
? STextStyles.desktopTextExtraSmall.copyWith(
color: StackTheme.instance.color.textDark3,
? STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
)
: STextStyles.smallMed12,
: STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
SizedBox(
@ -327,7 +338,7 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
value: e,
child: Text(
"$e words",
style: STextStyles.desktopTextMedium,
style: STextStyles.desktopTextMedium(context),
),
),
),
@ -343,21 +354,26 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
Assets.svg.chevronDown,
width: 12,
height: 6,
color: StackTheme
.instance.color.textFieldActiveSearchIconRight,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldActiveSearchIconRight,
),
buttonPadding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 8,
),
buttonDecoration: BoxDecoration(
color: StackTheme.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
),
dropdownDecoration: BoxDecoration(
color: StackTheme.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),

View file

@ -5,7 +5,7 @@ import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_co
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class MobileMnemonicLengthSelector extends ConsumerWidget {
const MobileMnemonicLengthSelector({
@ -29,7 +29,7 @@ class MobileMnemonicLengthSelector extends ConsumerWidget {
horizontal: 12,
),
child: RawMaterialButton(
splashColor: StackTheme.instance.color.highlight,
splashColor: Theme.of(context).extension<StackColors>()!.highlight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
@ -41,13 +41,14 @@ class MobileMnemonicLengthSelector extends ConsumerWidget {
children: [
Text(
"${ref.watch(mnemonicWordCountStateProvider.state).state} words",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
SvgPicture.asset(
Assets.svg.chevronDown,
width: 8,
height: 4,
color: StackTheme.instance.color.textSubtitle2,
color:
Theme.of(context).extension<StackColors>()!.textSubtitle2,
),
],
),

View file

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class RestoreFromDatePicker extends StatefulWidget {
const RestoreFromDatePicker({Key? key, required this.onTap})
@ -39,7 +39,7 @@ class _RestoreFromDatePickerState extends State<RestoreFromDatePicker> {
child: TextField(
onTap: onTap,
controller: _dateController,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: InputDecoration(
hintText: "Restore from...",
suffixIcon: UnconstrainedBox(
@ -50,7 +50,7 @@ class _RestoreFromDatePickerState extends State<RestoreFromDatePicker> {
),
SvgPicture.asset(
Assets.svg.calendar,
color: StackTheme.instance.color.textDark3,
color: Theme.of(context).extension<StackColors>()!.textDark3,
width: 16,
height: 16,
),

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class RestoreOptionsNextButton extends StatelessWidget {
const RestoreOptionsNextButton({
@ -21,11 +21,15 @@ class RestoreOptionsNextButton extends StatelessWidget {
child: TextButton(
onPressed: onPressed,
style: onPressed != null
? StackTheme.instance.getPrimaryEnabledButtonColor(context)
: StackTheme.instance.getPrimaryDisabledButtonColor(context),
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
child: Text(
"Next",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
);

View file

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class RestoreOptionsPlatformLayout extends StatelessWidget {
const RestoreOptionsPlatformLayout({
@ -17,7 +17,7 @@ class RestoreOptionsPlatformLayout extends StatelessWidget {
return child;
} else {
return Container(
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
child: Padding(
padding: const EdgeInsets.all(16),
child: LayoutBuilder(

View file

@ -33,7 +33,7 @@ import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/enums/form_input_status_enum.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/clipboard_icon.dart';
@ -354,27 +354,35 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
Widget? suffixIcon;
switch (status) {
case FormInputStatus.empty:
color = StackTheme.instance.color.textFieldDefaultBG;
prefixColor = StackTheme.instance.color.textSubtitle2;
color = Theme.of(context).extension<StackColors>()!.textFieldDefaultBG;
prefixColor = Theme.of(context).extension<StackColors>()!.textSubtitle2;
break;
case FormInputStatus.invalid:
color = StackTheme.instance.color.textFieldErrorBG;
prefixColor = StackTheme.instance.color.textFieldErrorSearchIconLeft;
color = Theme.of(context).extension<StackColors>()!.textFieldErrorBG;
prefixColor = Theme.of(context)
.extension<StackColors>()!
.textFieldErrorSearchIconLeft;
suffixIcon = SvgPicture.asset(
Assets.svg.alertCircle,
width: 16,
height: 16,
color: StackTheme.instance.color.textFieldErrorSearchIconRight,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldErrorSearchIconRight,
);
break;
case FormInputStatus.valid:
color = StackTheme.instance.color.textFieldSuccessBG;
prefixColor = StackTheme.instance.color.textFieldSuccessSearchIconLeft;
color = Theme.of(context).extension<StackColors>()!.textFieldSuccessBG;
prefixColor = Theme.of(context)
.extension<StackColors>()!
.textFieldSuccessSearchIconLeft;
suffixIcon = SvgPicture.asset(
Assets.svg.checkCircle,
width: 16,
height: 16,
color: StackTheme.instance.color.textFieldSuccessSearchIconRight,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldSuccessSearchIconRight,
);
break;
}
@ -394,7 +402,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
),
child: Text(
prefix,
style: STextStyles.fieldLabel.copyWith(
style: STextStyles.fieldLabel(context).copyWith(
color: prefixColor,
),
),
@ -547,11 +555,13 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
key: const Key("restoreWalletViewQrCodeButton"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: QrCodeIcon(
width: 20,
height: 20,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
onPressed: scanMnemonicQr,
),
@ -569,11 +579,13 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
key: const Key("restoreWalletPasteButton"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: ClipboardIcon(
width: 20,
height: 20,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
onPressed: pasteMnemonic,
),
@ -582,28 +594,28 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
],
),
body: Container(
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
children: [
Text(
widget.walletName,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 4,
),
Text(
"Recovery phrase",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 8,
),
Text(
"Enter your $_seedWordCount-word recovery phrase.",
style: STextStyles.subtitle,
style: STextStyles.subtitle(context),
),
const SizedBox(
height: 10,
@ -653,7 +665,11 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
}
},
controller: _controllers[i - 1],
style: STextStyles.field,
style: STextStyles.field(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.overlay,
),
),
),
if (_inputStatuses[i - 1] ==
@ -668,9 +684,11 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
child: Text(
"Please check spelling",
textAlign: TextAlign.left,
style: STextStyles.label.copyWith(
color: StackTheme
.instance.color.textError,
style:
STextStyles.label(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textError,
),
),
),
@ -682,12 +700,13 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
top: 8.0,
),
child: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: requestRestore,
child: Text(
"Restore",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
),

View file

@ -3,7 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class MnemonicWordCountSelectSheet extends ConsumerWidget {
const MnemonicWordCountSelectSheet({
@ -23,7 +23,7 @@ class MnemonicWordCountSelectSheet extends ConsumerWidget {
},
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(20),
),
@ -42,7 +42,9 @@ class MnemonicWordCountSelectSheet extends ConsumerWidget {
Center(
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -62,7 +64,7 @@ class MnemonicWordCountSelectSheet extends ConsumerWidget {
children: [
Text(
"Phrase length",
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -96,8 +98,9 @@ class MnemonicWordCountSelectSheet extends ConsumerWidget {
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme
.instance.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: lengthOptions[i],
groupValue: ref
.watch(mnemonicWordCountStateProvider
@ -119,7 +122,7 @@ class MnemonicWordCountSelectSheet extends ConsumerWidget {
),
Text(
"${lengthOptions[i]} words",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
],

View file

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class RestoreFailedDialog extends ConsumerStatefulWidget {
@ -45,10 +45,12 @@ class _RestoreFailedDialogState extends ConsumerState<RestoreFailedDialog> {
title: "Restore failed",
message: errorMessage,
rightButton: TextButton(
style: StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Ok",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
onPressed: () async {
ref

View file

@ -1,9 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class RestoreSucceededDialog extends StatelessWidget {
@ -18,13 +17,15 @@ class RestoreSucceededDialog extends StatelessWidget {
Assets.svg.checkCircle,
width: 24,
height: 24,
color: StackTheme.instance.color.accentColorGreen,
color: Theme.of(context).extension<StackColors>()!.accentColorGreen,
),
rightButton: TextButton(
style: StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Ok",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
onPressed: () {
Navigator.of(context).pop();

View file

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class RestoringDialog extends StatefulWidget {
@ -62,13 +62,16 @@ class _RestoringDialogState extends State<RestoringDialog>
child: SvgPicture.asset(Assets.svg.arrowRotate3,
width: 24,
height: 24,
color: StackTheme.instance.color.accentColorDark),
color:
Theme.of(context).extension<StackColors>()!.accentColorDark),
),
rightButton: TextButton(
style: StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
onPressed: () async {
await onCancel.call();

View file

@ -3,7 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class WordTableItem extends ConsumerWidget {
const WordTableItem({
@ -25,14 +25,14 @@ class WordTableItem extends ConsumerWidget {
return Container(
decoration: BoxDecoration(
color: selectedWord == word
? StackTheme.instance.color.snackBarBackInfo
: StackTheme.instance.color.popupBG,
? Theme.of(context).extension<StackColors>()!.snackBarBackInfo
: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
),
child: MaterialButton(
splashColor: StackTheme.instance.color.highlight,
splashColor: Theme.of(context).extension<StackColors>()!.highlight,
key: Key("coinSelectItemButtonKey_$word"),
padding: isDesktop
? const EdgeInsets.symmetric(
@ -55,10 +55,11 @@ class WordTableItem extends ConsumerWidget {
word,
textAlign: TextAlign.center,
style: isDesktop
? STextStyles.desktopTextExtraSmall.copyWith(
color: StackTheme.instance.color.textDark,
? STextStyles.desktopTextExtraSmall(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.textDark,
)
: STextStyles.baseXS,
: STextStyles.baseXS(context),
),
],
),

View file

@ -12,11 +12,10 @@ import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/manager.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
@ -244,8 +243,8 @@ class _VerifyRecoveryPhraseViewState
"Verify recovery phrase",
textAlign: TextAlign.center,
style: isDesktop
? STextStyles.desktopH2
: STextStyles.label.copyWith(
? STextStyles.desktopH2(context)
: STextStyles.label(context).copyWith(
fontSize: 12,
),
),
@ -256,15 +255,17 @@ class _VerifyRecoveryPhraseViewState
isDesktop ? "Select word number" : "Tap word number ",
textAlign: TextAlign.center,
style: isDesktop
? STextStyles.desktopSubtitleH1
: STextStyles.pageTitleH1,
? STextStyles.desktopSubtitleH1(context)
: STextStyles.pageTitleH1(context),
),
SizedBox(
height: isDesktop ? 16 : 12,
),
Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius),
),
@ -276,7 +277,7 @@ class _VerifyRecoveryPhraseViewState
child: Text(
"${correctIndex + 1}",
textAlign: TextAlign.center,
style: STextStyles.subtitle.copyWith(
style: STextStyles.subtitle(context).copyWith(
fontWeight: FontWeight.w600,
fontSize: 32,
letterSpacing: 0.25,
@ -323,20 +324,24 @@ class _VerifyRecoveryPhraseViewState
}
: null,
style: selectedWord.isNotEmpty
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
child: isDesktop
? Text(
"Verify",
style: selectedWord.isNotEmpty
? STextStyles.desktopButtonEnabled
: STextStyles.desktopButtonDisabled,
? STextStyles.desktopButtonEnabled(
context)
: STextStyles.desktopButtonDisabled(
context),
)
: Text(
"Continue",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
);

View file

@ -12,7 +12,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/address_book_card.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
@ -102,7 +102,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
addressBookServiceProvider.select((value) => value.addressBookEntries));
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -111,7 +111,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
),
title: Text(
"Address book",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
actions: [
Padding(
@ -126,10 +126,12 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
key: const Key("addressBookFilterViewButton"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
Assets.svg.filter,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 20,
height: 20,
),
@ -153,10 +155,12 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
key: const Key("addressBookAddNewContactViewButton"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
Assets.svg.plus,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 20,
height: 20,
),
@ -201,10 +205,11 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
_searchTerm = value;
});
},
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Search",
_searchFocusNode,
context,
).copyWith(
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(
@ -244,7 +249,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
),
Text(
"Favorites",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 12,
@ -297,7 +302,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
child: Center(
child: Text(
"Your favorite contacts will appear here",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
),
);
@ -310,7 +315,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
),
Text(
"All contacts",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 12,
@ -360,7 +365,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
child: Center(
child: Text(
"Your contacts will appear here",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
),
);

View file

@ -14,7 +14,7 @@ import 'package:stackwallet/utilities/barcode_scanner_interface.dart';
import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/emoji_select_sheet.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
@ -93,7 +93,7 @@ class _AddAddressBookEntryViewState
debugPrint("BUILD: $runtimeType");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -108,7 +108,7 @@ class _AddAddressBookEntryViewState
),
title: Text(
"New contact",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
actions: [
Padding(
@ -123,12 +123,16 @@ class _AddAddressBookEntryViewState
key: const Key("addAddressBookEntryFavoriteButtonKey"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
Assets.svg.star,
color: _isFavorite
? StackTheme.instance.color.accentColorRed
: StackTheme.instance.color.buttonBackSecondary,
? Theme.of(context)
.extension<StackColors>()!
.favoriteStarActive
: Theme.of(context)
.extension<StackColors>()!
.favoriteStarInactive,
width: 20,
height: 20,
),
@ -200,8 +204,9 @@ class _AddAddressBookEntryViewState
width: 48,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24),
color: StackTheme
.instance.color.textFieldActiveBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldActiveBG,
),
child: Center(
child: _selectedEmoji == null
@ -212,7 +217,8 @@ class _AddAddressBookEntryViewState
)
: Text(
_selectedEmoji!.char,
style: STextStyles.pageTitleH1,
style:
STextStyles.pageTitleH1(context),
),
),
),
@ -223,21 +229,24 @@ class _AddAddressBookEntryViewState
width: 14,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14),
color: StackTheme
.instance.color.accentColorDark),
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
child: Center(
child: _selectedEmoji == null
? SvgPicture.asset(
Assets.svg.plus,
color: StackTheme
.instance.color.textWhite,
color: Theme.of(context)
.extension<StackColors>()!
.textWhite,
width: 12,
height: 12,
)
: SvgPicture.asset(
Assets.svg.thickX,
color: StackTheme
.instance.color.textWhite,
color: Theme.of(context)
.extension<StackColors>()!
.textWhite,
width: 8,
height: 8,
),
@ -258,10 +267,11 @@ class _AddAddressBookEntryViewState
child: TextField(
controller: nameController,
focusNode: nameFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Enter contact name",
nameFocusNode,
context,
).copyWith(
suffixIcon: ref
.read(contactNameIsNotEmptyStateProvider
@ -308,7 +318,7 @@ class _AddAddressBookEntryViewState
),
Text(
"Address ${i + 1}",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 8,
@ -330,7 +340,7 @@ class _AddAddressBookEntryViewState
},
child: Text(
"+ Add another address",
style: STextStyles.largeMedium14,
style: STextStyles.largeMedium14(context),
),
),
const SizedBox(
@ -341,13 +351,15 @@ class _AddAddressBookEntryViewState
children: [
Expanded(
child: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Cancel",
style: STextStyles.button.copyWith(
color: StackTheme
.instance.color.accentColorDark),
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
onPressed: () async {
if (FocusScope.of(context).hasFocus) {
@ -382,9 +394,11 @@ class _AddAddressBookEntryViewState
return TextButton(
style: shouldEnableSave
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(
context),
onPressed: shouldEnableSave
@ -424,7 +438,7 @@ class _AddAddressBookEntryViewState
: null,
child: Text(
"Save",
style: STextStyles.button,
style: STextStyles.button(context),
),
);
},

View file

@ -11,7 +11,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/barcode_scanner_interface.dart';
import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
class AddNewContactAddressView extends ConsumerStatefulWidget {
@ -56,7 +56,7 @@ class _AddNewContactAddressViewState
.select((value) => value.getContactById(contactId)));
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -71,7 +71,7 @@ class _AddNewContactAddressViewState
),
title: Text(
"Add new address",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -99,8 +99,9 @@ class _AddNewContactAddressViewState
width: 48,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24),
color:
StackTheme.instance.color.textFieldActiveBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldActiveBG,
),
child: Center(
child: contact.emojiChar == null
@ -111,7 +112,7 @@ class _AddNewContactAddressViewState
)
: Text(
contact.emojiChar!,
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
),
),
@ -123,7 +124,7 @@ class _AddNewContactAddressViewState
fit: BoxFit.scaleDown,
child: Text(
contact.name,
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
),
),
),
@ -145,13 +146,15 @@ class _AddNewContactAddressViewState
children: [
Expanded(
child: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Cancel",
style: STextStyles.button.copyWith(
color: StackTheme
.instance.color.accentColorDark),
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
onPressed: () async {
if (FocusScope.of(context).hasFocus) {
@ -176,10 +179,12 @@ class _AddNewContactAddressViewState
return TextButton(
style: shouldEnableSave
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(
context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(
context),
onPressed: shouldEnableSave
@ -218,7 +223,7 @@ class _AddNewContactAddressViewState
: null,
child: Text(
"Save",
style: STextStyles.button,
style: STextStyles.button(context),
),
);
},

View file

@ -4,7 +4,7 @@ import 'package:stackwallet/providers/global/prefs_provider.dart';
import 'package:stackwallet/providers/ui/address_book_providers/address_book_filter_provider.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -42,9 +42,9 @@ class _AddressBookFilterViewState extends ConsumerState<AddressBookFilterView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
leading: AppBarBackButton(
onPressed: () async {
Navigator.of(context).pop();
@ -52,7 +52,7 @@ class _AddressBookFilterViewState extends ConsumerState<AddressBookFilterView> {
),
title: Text(
"Filter addresses",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -72,7 +72,7 @@ class _AddressBookFilterViewState extends ConsumerState<AddressBookFilterView> {
RoundedWhiteContainer(
child: Text(
"Only selected cryptocurrency addresses will be displayed.",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
),
const SizedBox(
@ -80,7 +80,7 @@ class _AddressBookFilterViewState extends ConsumerState<AddressBookFilterView> {
),
Text(
"Select cryptocurrency",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 12,
@ -154,7 +154,8 @@ class _AddressBookFilterViewState extends ConsumerState<AddressBookFilterView> {
Text(
coin.prettyName,
style:
STextStyles.largeMedium14,
STextStyles.largeMedium14(
context),
),
const SizedBox(
height: 2,
@ -162,7 +163,8 @@ class _AddressBookFilterViewState extends ConsumerState<AddressBookFilterView> {
Text(
coin.ticker,
style:
STextStyles.itemSubtitle,
STextStyles.itemSubtitle(
context),
),
],
)

View file

@ -6,7 +6,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class CoinSelectSheet extends StatelessWidget {
const CoinSelectSheet({Key? key}) : super(key: key);
@ -18,7 +18,7 @@ class CoinSelectSheet extends StatelessWidget {
coins_.remove(Coin.firoTestNet);
return Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(20),
),
@ -39,7 +39,9 @@ class CoinSelectSheet extends StatelessWidget {
Center(
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -53,7 +55,7 @@ class CoinSelectSheet extends StatelessWidget {
),
Text(
"Select address cryptocurrency",
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -77,7 +79,7 @@ class CoinSelectSheet extends StatelessWidget {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
onPressed: () {
Navigator.of(context).pop(coin);
},
@ -95,7 +97,7 @@ class CoinSelectSheet extends StatelessWidget {
),
Text(
coin.prettyName,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),

View file

@ -17,7 +17,7 @@ import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
@ -105,7 +105,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
.select((value) => value.getContactById(_contactId)));
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -114,7 +114,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
),
title: Text(
"Contact details",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
actions: [
Padding(
@ -129,12 +129,16 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
key: const Key("contactDetails"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
Assets.svg.star,
color: _contact.isFavorite
? StackTheme.instance.color.infoItemIcons
: StackTheme.instance.color.buttonBackSecondary,
? Theme.of(context)
.extension<StackColors>()!
.favoriteStarActive
: Theme.of(context)
.extension<StackColors>()!
.favoriteStarInactive,
width: 20,
height: 20,
),
@ -160,10 +164,12 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
key: const Key("contactDetailsViewDeleteContactButtonKey"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
Assets.svg.trash,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 20,
height: 20,
),
@ -176,22 +182,24 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
title: "Delete ${_contact.name}?",
message: "Contact will be deleted permanently!",
leftButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
onPressed: () {
Navigator.of(context).pop();
},
),
rightButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Delete",
style: STextStyles.button,
style: STextStyles.button(context),
),
onPressed: () {
ref
@ -234,7 +242,9 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
width: 48,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24),
color: StackTheme.instance.color.textFieldActiveBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldActiveBG,
),
child: Center(
child: _contact.emojiChar == null
@ -245,7 +255,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
)
: Text(
_contact.emojiChar!,
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
),
),
@ -257,7 +267,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
child: Text(
_contact.name,
textAlign: TextAlign.left,
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
),
),
const Spacer(),
@ -268,7 +278,8 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
arguments: _contact.id,
);
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context)!
.copyWith(
minimumSize: MaterialStateProperty.all<Size>(
@ -281,14 +292,15 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
SvgPicture.asset(Assets.svg.pencil,
width: 10,
height: 10,
color:
StackTheme.instance.color.accentColorDark),
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
const SizedBox(
width: 4,
),
Text(
"Edit",
style: STextStyles.buttonSmall,
style: STextStyles.buttonSmall(context),
),
],
),
@ -304,7 +316,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
children: [
Text(
"Addresses",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
BlueTextButton(
text: "Add new",
@ -342,7 +354,8 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
children: [
Text(
"${e.label} (${e.coin.ticker})",
style: STextStyles.itemSubtitle12,
style:
STextStyles.itemSubtitle12(context),
),
const SizedBox(
height: 2,
@ -351,8 +364,8 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
fit: BoxFit.scaleDown,
child: Text(
e.address,
style:
STextStyles.itemSubtitle.copyWith(
style: STextStyles.itemSubtitle(context)
.copyWith(
fontSize: 8,
),
),
@ -377,14 +390,16 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
);
},
child: RoundedContainer(
color: StackTheme
.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
padding: const EdgeInsets.all(4),
child: SvgPicture.asset(Assets.svg.pencil,
width: 12,
height: 12,
color: StackTheme
.instance.color.accentColorDark),
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
const SizedBox(
@ -403,14 +418,16 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
);
},
child: RoundedContainer(
color: StackTheme
.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
padding: const EdgeInsets.all(4),
child: SvgPicture.asset(Assets.svg.copy,
width: 12,
height: 12,
color: StackTheme
.instance.color.accentColorDark),
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
],
@ -425,7 +442,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
),
Text(
"Transaction history",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 12,
@ -461,7 +478,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
child: Center(
child: Text(
"No transactions found",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
),
);

View file

@ -14,7 +14,7 @@ import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
import 'package:tuple/tuple.dart';
@ -71,7 +71,8 @@ class ContactPopUp extends ConsumerWidget {
),
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color:
Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: BorderRadius.circular(
20,
),
@ -98,8 +99,9 @@ class ContactPopUp extends ConsumerWidget {
width: 32,
height: 32,
decoration: BoxDecoration(
color: StackTheme
.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
borderRadius: BorderRadius.circular(32),
),
child: contact.id == "default"
@ -127,7 +129,8 @@ class ContactPopUp extends ConsumerWidget {
Expanded(
child: Text(
contact.name,
style: STextStyles.itemSubtitle12,
style:
STextStyles.itemSubtitle12(context),
),
),
if (contact.id != "default")
@ -139,7 +142,8 @@ class ContactPopUp extends ConsumerWidget {
arguments: contact.id,
);
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
context)!
.copyWith(
@ -151,7 +155,8 @@ class ContactPopUp extends ConsumerWidget {
padding: const EdgeInsets.symmetric(
horizontal: 18),
child: Text("Details",
style: STextStyles.buttonSmall),
style: STextStyles.buttonSmall(
context)),
),
),
],
@ -162,7 +167,9 @@ class ContactPopUp extends ConsumerWidget {
),
Container(
height: 1,
color: StackTheme.instance.color.background,
color: Theme.of(context)
.extension<StackColors>()!
.background,
),
if (addresses.isEmpty)
Padding(
@ -172,7 +179,8 @@ class ContactPopUp extends ConsumerWidget {
child: Center(
child: Text(
"No ${active[0].coin.prettyName} addresses found",
style: STextStyles.itemSubtitle,
style:
STextStyles.itemSubtitle(context),
),
),
),
@ -212,20 +220,23 @@ class ContactPopUp extends ConsumerWidget {
Text(
e.other!,
style:
STextStyles.itemSubtitle12,
STextStyles.itemSubtitle12(
context),
),
if (contact.id != "default")
Text(
"${e.label} (${e.coin.ticker})",
style:
STextStyles.itemSubtitle12,
STextStyles.itemSubtitle12(
context),
),
const SizedBox(
height: 2,
),
Text(
e.address,
style: STextStyles.itemSubtitle
style: STextStyles.itemSubtitle(
context)
.copyWith(
fontSize: 8,
),
@ -254,15 +265,17 @@ class ContactPopUp extends ConsumerWidget {
);
},
child: RoundedContainer(
color: StackTheme.instance.color
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
padding: const EdgeInsets.all(4),
child: SvgPicture.asset(
Assets.svg.copy,
width: 12,
height: 12,
color: StackTheme.instance
.color.accentColorDark),
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
],
@ -305,7 +318,8 @@ class ContactPopUp extends ConsumerWidget {
}
},
child: RoundedContainer(
color: StackTheme.instance.color
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
padding:
const EdgeInsets.all(4),
@ -314,8 +328,10 @@ class ContactPopUp extends ConsumerWidget {
.svg.circleArrowUpRight,
width: 12,
height: 12,
color: StackTheme.instance
.color.accentColorDark),
color: Theme.of(context)
.extension<
StackColors>()!
.accentColorDark),
),
),
],

View file

@ -11,7 +11,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/barcode_scanner_interface.dart';
import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
class EditContactAddressView extends ConsumerStatefulWidget {
@ -60,7 +60,7 @@ class _EditContactAddressViewState
.select((value) => value.getContactById(contactId)));
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -75,7 +75,7 @@ class _EditContactAddressViewState
),
title: Text(
"Edit address",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -103,8 +103,9 @@ class _EditContactAddressViewState
width: 48,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24),
color:
StackTheme.instance.color.textFieldActiveBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldActiveBG,
),
child: Center(
child: contact.emojiChar == null
@ -115,7 +116,7 @@ class _EditContactAddressViewState
)
: Text(
contact.emojiChar!,
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
),
),
@ -127,7 +128,7 @@ class _EditContactAddressViewState
fit: BoxFit.scaleDown,
child: Text(
contact.name,
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
),
),
),
@ -169,7 +170,7 @@ class _EditContactAddressViewState
},
child: Text(
"Delete address",
style: STextStyles.link,
style: STextStyles.link(context),
),
),
const Spacer(),
@ -180,13 +181,15 @@ class _EditContactAddressViewState
children: [
Expanded(
child: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Cancel",
style: STextStyles.button.copyWith(
color: StackTheme
.instance.color.accentColorDark),
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
onPressed: () async {
if (FocusScope.of(context).hasFocus) {
@ -211,10 +214,12 @@ class _EditContactAddressViewState
return TextButton(
style: shouldEnableSave
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(
context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(
context),
onPressed: shouldEnableSave
@ -268,7 +273,7 @@ class _EditContactAddressViewState
: null,
child: Text(
"Save",
style: STextStyles.button,
style: STextStyles.button(context),
),
);
},

View file

@ -6,7 +6,7 @@ import 'package:stackwallet/providers/global/address_book_service_provider.dart'
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/emoji_select_sheet.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
@ -68,7 +68,7 @@ class _EditContactNameEmojiViewState
.select((value) => value.getContactById(contactId)));
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -83,7 +83,7 @@ class _EditContactNameEmojiViewState
),
title: Text(
"Edit contact",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -139,8 +139,9 @@ class _EditContactNameEmojiViewState
width: 48,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24),
color: StackTheme
.instance.color.textFieldActiveBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldActiveBG,
),
child: Center(
child: _selectedEmoji == null
@ -151,7 +152,8 @@ class _EditContactNameEmojiViewState
)
: Text(
_selectedEmoji!.char,
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(
context),
),
),
),
@ -162,21 +164,24 @@ class _EditContactNameEmojiViewState
width: 14,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14),
color: StackTheme
.instance.color.accentColorDark),
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
child: Center(
child: _selectedEmoji == null
? SvgPicture.asset(
Assets.svg.plus,
color: StackTheme
.instance.color.textWhite,
color: Theme.of(context)
.extension<StackColors>()!
.textWhite,
width: 12,
height: 12,
)
: SvgPicture.asset(
Assets.svg.thickX,
color: StackTheme
.instance.color.textWhite,
color: Theme.of(context)
.extension<StackColors>()!
.textWhite,
width: 8,
height: 8,
),
@ -197,11 +202,12 @@ class _EditContactNameEmojiViewState
child: TextField(
controller: nameController,
focusNode: nameFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
onChanged: (_) => setState(() {}),
decoration: standardInputDecoration(
"Enter contact name",
nameFocusNode,
context,
).copyWith(
suffixIcon: nameController.text.isNotEmpty
? Padding(
@ -233,13 +239,15 @@ class _EditContactNameEmojiViewState
children: [
Expanded(
child: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Cancel",
style: STextStyles.button.copyWith(
color: StackTheme
.instance.color.accentColorDark),
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
onPressed: () async {
if (FocusScope.of(context).hasFocus) {
@ -264,10 +272,12 @@ class _EditContactNameEmojiViewState
return TextButton(
style: shouldEnableSave
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(
context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(
context),
onPressed: shouldEnableSave
@ -301,7 +311,7 @@ class _EditContactNameEmojiViewState
: null,
child: Text(
"Save",
style: STextStyles.button,
style: STextStyles.button(context),
),
);
},

View file

@ -8,13 +8,12 @@ import 'package:stackwallet/providers/ui/address_book_providers/address_entry_da
import 'package:stackwallet/utilities/address_utils.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/barcode_scanner_interface.dart';
import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/icon_widgets/clipboard_icon.dart';
import 'package:stackwallet/widgets/icon_widgets/qrcode_icon.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
@ -73,15 +72,16 @@ class _NewContactAddressEntryFormState
children: [
TextField(
readOnly: true,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: InputDecoration(
hintText: "Select cryptocurrency",
hintStyle: STextStyles.fieldLabel,
hintStyle: STextStyles.fieldLabel(context),
prefixIcon: Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: RawMaterialButton(
splashColor: StackTheme.instance.color.highlight,
splashColor:
Theme.of(context).extension<StackColors>()!.highlight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
@ -107,7 +107,7 @@ class _NewContactAddressEntryFormState
null
? Text(
"Select cryptocurrency",
style: STextStyles.fieldLabel,
style: STextStyles.fieldLabel(context),
)
: Row(
children: [
@ -127,7 +127,7 @@ class _NewContactAddressEntryFormState
.watch(addressEntryDataProvider(widget.id)
.select((value) => value.coin))!
.prettyName,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),
@ -135,7 +135,9 @@ class _NewContactAddressEntryFormState
Assets.svg.chevronDown,
width: 8,
height: 4,
color: StackTheme.instance.color.textSubtitle2,
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle2,
),
],
),
@ -154,10 +156,11 @@ class _NewContactAddressEntryFormState
child: TextField(
focusNode: addressLabelFocusNode,
controller: addressLabelController,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Enter address label",
addressLabelFocusNode,
context,
).copyWith(
suffixIcon: addressLabelController.text.isNotEmpty
? Padding(
@ -196,10 +199,11 @@ class _NewContactAddressEntryFormState
child: TextField(
focusNode: addressFocusNode,
controller: addressController,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Paste address",
addressFocusNode,
context,
).copyWith(
suffixIcon: UnconstrainedBox(
child: Row(
@ -352,8 +356,9 @@ class _NewContactAddressEntryFormState
Text(
"Invalid address",
textAlign: TextAlign.left,
style: STextStyles.label.copyWith(
color: StackTheme.instance.color.textError,
style: STextStyles.label(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.textError,
),
),
],

View file

@ -20,7 +20,7 @@ class _BuyViewState extends State<BuyView> {
Center(
child: Text(
"Coming soon",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
),
],

View file

@ -13,7 +13,7 @@ import 'package:stackwallet/route_generator.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -97,12 +97,15 @@ class _ConfirmChangeNowSendViewState
title: "Broadcast transaction failed",
message: e.toString(),
rightButton: TextButton(
style:
StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Ok",
style: STextStyles.button.copyWith(
color: StackTheme.instance.color.buttonTextSecondary,
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
),
onPressed: () {
@ -130,7 +133,7 @@ class _ConfirmChangeNowSendViewState
.select((value) => value.getManagerProvider(walletId)));
return Scaffold(
appBar: AppBar(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
leading: AppBarBackButton(
onPressed: () async {
// if (FocusScope.of(context).hasFocus) {
@ -142,7 +145,7 @@ class _ConfirmChangeNowSendViewState
),
title: Text(
"Confirm transaction",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -166,7 +169,7 @@ class _ConfirmChangeNowSendViewState
children: [
Text(
"Send ${ref.watch(managerProvider.select((value) => value.coin)).ticker}",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 12,
@ -177,7 +180,7 @@ class _ConfirmChangeNowSendViewState
children: [
Text(
"Send from",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 4,
@ -187,7 +190,7 @@ class _ConfirmChangeNowSendViewState
.watch(walletsChangeNotifierProvider)
.getManager(walletId)
.walletName,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),
@ -204,14 +207,14 @@ class _ConfirmChangeNowSendViewState
children: [
Text(
"ChangeNOW address",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 4,
),
Text(
"${transactionInfo["address"] ?? "ERROR"}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),
@ -225,7 +228,7 @@ class _ConfirmChangeNowSendViewState
children: [
Text(
"Amount",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
Text(
"${Format.satoshiAmountToPrettyString(
@ -238,7 +241,7 @@ class _ConfirmChangeNowSendViewState
managerProvider
.select((value) => value.coin),
).ticker}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
textAlign: TextAlign.right,
),
],
@ -253,7 +256,7 @@ class _ConfirmChangeNowSendViewState
children: [
Text(
"Transaction fee",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
Text(
"${Format.satoshiAmountToPrettyString(
@ -266,7 +269,7 @@ class _ConfirmChangeNowSendViewState
managerProvider
.select((value) => value.coin),
).ticker}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
textAlign: TextAlign.right,
),
],
@ -281,14 +284,14 @@ class _ConfirmChangeNowSendViewState
children: [
Text(
"Note",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 4,
),
Text(
transactionInfo["note"] as String? ?? "",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),
@ -302,11 +305,11 @@ class _ConfirmChangeNowSendViewState
children: [
Text(
"Trade ID",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
Text(
trade.id,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
textAlign: TextAlign.right,
),
],
@ -316,13 +319,15 @@ class _ConfirmChangeNowSendViewState
height: 12,
),
RoundedContainer(
color: StackTheme.instance.color.snackBarBackSuccess,
color: Theme.of(context)
.extension<StackColors>()!
.snackBarBackSuccess,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Total amount",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
Text(
"${Format.satoshiAmountToPrettyString(
@ -336,7 +341,7 @@ class _ConfirmChangeNowSendViewState
managerProvider
.select((value) => value.coin),
).ticker}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
textAlign: TextAlign.right,
),
],
@ -347,7 +352,8 @@ class _ConfirmChangeNowSendViewState
),
const Spacer(),
TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: () async {
final unlocked = await Navigator.push(
@ -377,7 +383,7 @@ class _ConfirmChangeNowSendViewState
},
child: Text(
"Send",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],

View file

@ -3,7 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/providers/exchange/trade_note_service_provider.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
import 'package:stackwallet/widgets/stack_text_field.dart';
@ -46,9 +46,9 @@ class _EditNoteViewState extends ConsumerState<EditTradeNoteView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
leading: AppBarBackButton(
onPressed: () async {
if (FocusScope.of(context).hasFocus) {
@ -62,7 +62,7 @@ class _EditNoteViewState extends ConsumerState<EditTradeNoteView> {
),
title: Text(
"Edit trade note",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -86,12 +86,13 @@ class _EditNoteViewState extends ConsumerState<EditTradeNoteView> {
),
child: TextField(
controller: _noteController,
style: STextStyles.field,
style: STextStyles.field(context),
focusNode: noteFieldFocusNode,
onChanged: (_) => setState(() {}),
decoration: standardInputDecoration(
"Note",
noteFieldFocusNode,
context,
).copyWith(
suffixIcon: _noteController.text.isNotEmpty
? Padding(
@ -126,11 +127,12 @@ class _EditNoteViewState extends ConsumerState<EditTradeNoteView> {
Navigator.of(context).pop();
}
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Save",
style: STextStyles.button,
style: STextStyles.button(context),
),
)
],

View file

@ -7,7 +7,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
@ -119,7 +119,7 @@ class _FixedRateMarketPairCoinSelectionViewState
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -134,7 +134,7 @@ class _FixedRateMarketPairCoinSelectionViewState
),
title: Text(
"Choose a coin to exchange",
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
),
),
body: Padding(
@ -155,10 +155,11 @@ class _FixedRateMarketPairCoinSelectionViewState
controller: _searchController,
focusNode: _searchFocusNode,
onChanged: filter,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Search",
_searchFocusNode,
context,
).copyWith(
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(
@ -198,7 +199,7 @@ class _FixedRateMarketPairCoinSelectionViewState
),
Text(
"Popular coins",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 12,
@ -251,16 +252,18 @@ class _FixedRateMarketPairCoinSelectionViewState
children: [
Text(
tuple.item2,
style: STextStyles.largeMedium14,
style: STextStyles.largeMedium14(context),
),
const SizedBox(
height: 2,
),
Text(
ticker.toUpperCase(),
style: STextStyles.smallMed12.copyWith(
color: StackTheme
.instance.color.textSubtitle1,
style: STextStyles.smallMed12(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
),
),
],
@ -280,7 +283,7 @@ class _FixedRateMarketPairCoinSelectionViewState
),
Text(
"All coins",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 12,
@ -325,16 +328,18 @@ class _FixedRateMarketPairCoinSelectionViewState
children: [
Text(
tuple.item2,
style: STextStyles.largeMedium14,
style: STextStyles.largeMedium14(context),
),
const SizedBox(
height: 2,
),
Text(
ticker.toUpperCase(),
style: STextStyles.smallMed12.copyWith(
color: StackTheme
.instance.color.textSubtitle1,
style: STextStyles.smallMed12(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
),
),
],

View file

@ -5,7 +5,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
@ -75,7 +75,7 @@ class _FloatingRateCurrencySelectionViewState
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -90,7 +90,7 @@ class _FloatingRateCurrencySelectionViewState
),
title: Text(
"Choose a coin to exchange",
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
),
),
body: Padding(
@ -111,10 +111,11 @@ class _FloatingRateCurrencySelectionViewState
controller: _searchController,
focusNode: _searchFocusNode,
onChanged: filter,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Search",
_searchFocusNode,
context,
).copyWith(
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(
@ -155,7 +156,7 @@ class _FloatingRateCurrencySelectionViewState
),
Text(
"Popular coins",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 12,
@ -203,16 +204,18 @@ class _FloatingRateCurrencySelectionViewState
children: [
Text(
items[index].name,
style: STextStyles.largeMedium14,
style: STextStyles.largeMedium14(context),
),
const SizedBox(
height: 2,
),
Text(
items[index].ticker.toUpperCase(),
style: STextStyles.smallMed12.copyWith(
color: StackTheme
.instance.color.textSubtitle1,
style: STextStyles.smallMed12(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
),
),
],
@ -232,7 +235,7 @@ class _FloatingRateCurrencySelectionViewState
),
Text(
"All coins",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 12,
@ -273,16 +276,18 @@ class _FloatingRateCurrencySelectionViewState
children: [
Text(
_currencies[index].name,
style: STextStyles.largeMedium14,
style: STextStyles.largeMedium14(context),
),
const SizedBox(
height: 2,
),
Text(
_currencies[index].ticker.toUpperCase(),
style: STextStyles.smallMed12.copyWith(
color: StackTheme
.instance.color.textSubtitle1,
style: STextStyles.smallMed12(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
),
),
],

View file

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/providers/exchange/changenow_initial_load_status.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -65,7 +65,10 @@ class _ExchangeLoadingOverlayViewState
if (_statusEst == ChangeNowLoadStatus.loading ||
(_statusFixed == ChangeNowLoadStatus.loading && userReloaded))
Container(
color: StackTheme.instance.color.overlay.withOpacity(0.7),
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withOpacity(0.7),
child: const CustomLoadingOverlay(
message: "Loading ChangeNOW data", eventBus: null),
),
@ -74,7 +77,10 @@ class _ExchangeLoadingOverlayViewState
_statusEst != ChangeNowLoadStatus.loading &&
_statusFixed != ChangeNowLoadStatus.loading)
Container(
color: StackTheme.instance.color.overlay.withOpacity(0.7),
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withOpacity(0.7),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
@ -83,12 +89,15 @@ class _ExchangeLoadingOverlayViewState
message:
"ChangeNOW requires a working internet connection. Tap OK to try fetching again.",
rightButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"OK",
style: STextStyles.button.copyWith(
color: StackTheme.instance.color.buttonTextSecondary,
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
),
onPressed: () {

View file

@ -5,7 +5,7 @@ import 'package:stackwallet/pages/exchange_view/sub_widgets/exchange_rate_sheet.
import 'package:stackwallet/pages/exchange_view/sub_widgets/step_row.dart';
import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -40,7 +40,7 @@ class _Step1ViewState extends State<Step1View> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -55,7 +55,7 @@ class _Step1ViewState extends State<Step1View> {
),
title: Text(
"Exchange",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -84,14 +84,14 @@ class _Step1ViewState extends State<Step1View> {
),
Text(
"Confirm amount",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 8,
),
Text(
"Network fees and other exchange charges are included in the rate.",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 24,
@ -102,15 +102,19 @@ class _Step1ViewState extends State<Step1View> {
children: [
Text(
"You send",
style: STextStyles.itemSubtitle.copyWith(
color:
StackTheme.instance.color.infoItemText),
style: STextStyles.itemSubtitle(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.infoItemText),
),
Text(
"${model.sendAmount.toStringAsFixed(8)} ${model.sendTicker.toUpperCase()}",
style: STextStyles.itemSubtitle12.copyWith(
color:
StackTheme.instance.color.infoItemText),
style: STextStyles.itemSubtitle12(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.infoItemText),
),
],
),
@ -124,15 +128,19 @@ class _Step1ViewState extends State<Step1View> {
children: [
Text(
"You receive",
style: STextStyles.itemSubtitle.copyWith(
color:
StackTheme.instance.color.infoItemText),
style: STextStyles.itemSubtitle(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.infoItemText),
),
Text(
"~${model.receiveAmount.toStringAsFixed(8)} ${model.receiveTicker.toUpperCase()}",
style: STextStyles.itemSubtitle12.copyWith(
color:
StackTheme.instance.color.infoItemText),
style: STextStyles.itemSubtitle12(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.infoItemText),
),
],
),
@ -148,16 +156,20 @@ class _Step1ViewState extends State<Step1View> {
model.rateType == ExchangeRateType.estimated
? "Estimated rate"
: "Fixed rate",
style: STextStyles.itemSubtitle.copyWith(
color:
StackTheme.instance.color.infoItemLabel,
style:
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.infoItemLabel,
),
),
Text(
model.rateInfo,
style: STextStyles.itemSubtitle12.copyWith(
color:
StackTheme.instance.color.infoItemText),
style: STextStyles.itemSubtitle12(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.infoItemText),
),
],
),
@ -171,11 +183,12 @@ class _Step1ViewState extends State<Step1View> {
Navigator.of(context).pushNamed(Step2View.routeName,
arguments: model);
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Next",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],

View file

@ -15,7 +15,7 @@ import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/addressbook_icon.dart';
import 'package:stackwallet/widgets/icon_widgets/clipboard_icon.dart';
@ -95,7 +95,7 @@ class _Step2ViewState extends ConsumerState<Step2View> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -110,7 +110,7 @@ class _Step2ViewState extends ConsumerState<Step2View> {
),
title: Text(
"Exchange",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -139,14 +139,14 @@ class _Step2ViewState extends ConsumerState<Step2View> {
),
Text(
"Exchange details",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 8,
),
Text(
"Enter your recipient and refund addresses",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 24,
@ -156,7 +156,7 @@ class _Step2ViewState extends ConsumerState<Step2View> {
children: [
Text(
"Recipient Wallet",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
// GestureDetector(
// onTap: () {
@ -164,7 +164,7 @@ class _Step2ViewState extends ConsumerState<Step2View> {
// },
// child: Text(
// "Choose from Stack",
// style: STextStyles.link2,
// style: STextStyles.link2(context),
// ),
// ),
],
@ -194,10 +194,11 @@ class _Step2ViewState extends ConsumerState<Step2View> {
selectAll: false,
),
focusNode: _toFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Enter the ${model.receiveTicker.toUpperCase()} payout address",
_toFocusNode,
context,
).copyWith(
contentPadding: const EdgeInsets.only(
left: 16,
@ -334,7 +335,7 @@ class _Step2ViewState extends ConsumerState<Step2View> {
RoundedWhiteContainer(
child: Text(
"This is the wallet where your ${model.receiveTicker.toUpperCase()} will be sent to.",
style: STextStyles.label,
style: STextStyles.label(context),
),
),
const SizedBox(
@ -345,7 +346,7 @@ class _Step2ViewState extends ConsumerState<Step2View> {
children: [
Text(
"Refund Wallet (required)",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
// GestureDetector(
// onTap: () {
@ -353,7 +354,7 @@ class _Step2ViewState extends ConsumerState<Step2View> {
// },
// child: Text(
// "Choose from Stack",
// style: STextStyles.link2,
// style: STextStyles.link2(context),
// ),
// ),
],
@ -382,10 +383,11 @@ class _Step2ViewState extends ConsumerState<Step2View> {
selectAll: false,
),
focusNode: _refundFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Enter ${model.sendTicker.toUpperCase()} refund address",
_refundFocusNode,
context,
).copyWith(
contentPadding: const EdgeInsets.only(
left: 16,
@ -524,7 +526,7 @@ class _Step2ViewState extends ConsumerState<Step2View> {
RoundedWhiteContainer(
child: Text(
"In case something goes wrong during the exchange, we might need a refund address so we can return your coins back to you.",
style: STextStyles.label,
style: STextStyles.label(context),
),
),
const Spacer(),
@ -535,13 +537,15 @@ class _Step2ViewState extends ConsumerState<Step2View> {
onPressed: () {
Navigator.of(context).pop();
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Back",
style: STextStyles.button.copyWith(
color: StackTheme
.instance.color.buttonTextSecondary,
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
),
),
@ -559,11 +563,12 @@ class _Step2ViewState extends ConsumerState<Step2View> {
Step3View.routeName,
arguments: model);
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Next",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
),

View file

@ -14,7 +14,7 @@ import 'package:stackwallet/services/notifications_api.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -50,7 +50,7 @@ class _Step3ViewState extends ConsumerState<Step3View> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -65,7 +65,7 @@ class _Step3ViewState extends ConsumerState<Step3View> {
),
title: Text(
"Exchange",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -94,7 +94,7 @@ class _Step3ViewState extends ConsumerState<Step3View> {
),
Text(
"Confirm exchange details",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 24,
@ -104,12 +104,12 @@ class _Step3ViewState extends ConsumerState<Step3View> {
children: [
Text(
"You send",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const Spacer(),
Text(
"${model.sendAmount.toString()} ${model.sendTicker.toUpperCase()}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
)
],
),
@ -122,12 +122,12 @@ class _Step3ViewState extends ConsumerState<Step3View> {
children: [
Text(
"You receive",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const Spacer(),
Text(
"${model.receiveAmount.toString()} ${model.receiveTicker.toUpperCase()}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
)
],
),
@ -140,12 +140,12 @@ class _Step3ViewState extends ConsumerState<Step3View> {
children: [
Text(
"Estimated rate",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const Spacer(),
Text(
model.rateInfo,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
)
],
),
@ -159,14 +159,14 @@ class _Step3ViewState extends ConsumerState<Step3View> {
children: [
Text(
"Recipient ${model.receiveTicker.toUpperCase()} address",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 4,
),
Text(
model.recipientAddress!,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
)
],
),
@ -180,14 +180,14 @@ class _Step3ViewState extends ConsumerState<Step3View> {
children: [
Text(
"Refund ${model.sendTicker.toUpperCase()} address",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 4,
),
Text(
model.refundAddress!,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
)
],
),
@ -203,13 +203,15 @@ class _Step3ViewState extends ConsumerState<Step3View> {
onPressed: () {
Navigator.of(context).pop();
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Back",
style: STextStyles.button.copyWith(
color: StackTheme
.instance.color.buttonTextSecondary,
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
),
),
@ -306,11 +308,12 @@ class _Step3ViewState extends ConsumerState<Step3View> {
));
}
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Next",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
),

View file

@ -24,7 +24,7 @@ import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -114,7 +114,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
final bool isWalletCoin =
_isWalletCoinAndHasWallet(model.trade!.fromCurrency, ref);
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -129,7 +129,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
),
title: Text(
"Exchange",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -158,34 +158,40 @@ class _Step4ViewState extends ConsumerState<Step4View> {
),
Text(
"Send ${model.sendTicker.toUpperCase()} to the address below",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 8,
),
Text(
"Send ${model.sendTicker.toUpperCase()} to the address below. Once it is received, ChangeNOW will send the ${model.receiveTicker.toUpperCase()} to the recipient address you provided. You can find this trade details and check its status in the list of trades.",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 12,
),
RoundedContainer(
color: StackTheme.instance.color.warningBackground,
color: Theme.of(context)
.extension<StackColors>()!
.warningBackground,
child: RichText(
text: TextSpan(
text:
"You must send at least ${model.sendAmount.toString()} ${model.sendTicker}. ",
style: STextStyles.label.copyWith(
color: StackTheme.instance.color.textDark,
style: STextStyles.label(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.warningForeground,
fontWeight: FontWeight.w700,
),
children: [
TextSpan(
text:
"If you send less than ${model.sendAmount.toString()} ${model.sendTicker}, your transaction may not be converted and it may not be refunded.",
style: STextStyles.label.copyWith(
color: StackTheme.instance.color.textDark,
style: STextStyles.label(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.warningForeground,
fontWeight: FontWeight.w500,
),
),
@ -206,7 +212,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
children: [
Text(
"Amount",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
GestureDetector(
onTap: () async {
@ -223,8 +229,9 @@ class _Step4ViewState extends ConsumerState<Step4View> {
children: [
SvgPicture.asset(
Assets.svg.copy,
color: StackTheme
.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
width: 10,
),
const SizedBox(
@ -232,7 +239,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
),
Text(
"Copy",
style: STextStyles.link2,
style: STextStyles.link2(context),
),
],
),
@ -244,7 +251,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
),
Text(
"${model.sendAmount.toString()} ${model.sendTicker.toUpperCase()}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),
@ -262,7 +269,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
children: [
Text(
"Send ${model.sendTicker.toUpperCase()} to this address",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
GestureDetector(
onTap: () async {
@ -279,8 +286,9 @@ class _Step4ViewState extends ConsumerState<Step4View> {
children: [
SvgPicture.asset(
Assets.svg.copy,
color: StackTheme
.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
width: 10,
),
const SizedBox(
@ -288,7 +296,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
),
Text(
"Copy",
style: STextStyles.link2,
style: STextStyles.link2(context),
),
],
),
@ -300,7 +308,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
),
Text(
model.trade!.payinAddress,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),
@ -313,14 +321,14 @@ class _Step4ViewState extends ConsumerState<Step4View> {
children: [
Text(
"Trade ID",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const Spacer(),
Row(
children: [
Text(
model.trade!.id,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
const SizedBox(
width: 10,
@ -338,8 +346,9 @@ class _Step4ViewState extends ConsumerState<Step4View> {
},
child: SvgPicture.asset(
Assets.svg.copy,
color: StackTheme
.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
width: 12,
),
)
@ -357,12 +366,14 @@ class _Step4ViewState extends ConsumerState<Step4View> {
children: [
Text(
"Status",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
Text(
_statusString,
style: STextStyles.itemSubtitle.copyWith(
color: StackTheme.instance
style:
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.colorForStatus(_status),
),
),
@ -388,7 +399,8 @@ class _Step4ViewState extends ConsumerState<Step4View> {
Center(
child: Text(
"Send ${model.sendTicker} to this address",
style: STextStyles.pageTitleH2,
style:
STextStyles.pageTitleH2(context),
),
),
const SizedBox(
@ -403,8 +415,9 @@ class _Step4ViewState extends ConsumerState<Step4View> {
.size
.width /
2,
foregroundColor: StackTheme
.instance.color.accentColorDark,
foregroundColor: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
),
const SizedBox(
@ -417,16 +430,17 @@ class _Step4ViewState extends ConsumerState<Step4View> {
child: TextButton(
onPressed: () =>
Navigator.of(context).pop(),
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
context),
child: Text(
"Cancel",
style:
STextStyles.button.copyWith(
color: StackTheme
.instance
.color
STextStyles.button(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
),
@ -440,11 +454,12 @@ class _Step4ViewState extends ConsumerState<Step4View> {
},
);
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Show QR Code",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
if (isWalletCoin)
@ -562,16 +577,18 @@ class _Step4ViewState extends ConsumerState<Step4View> {
title: "Transaction failed",
message: e.toString(),
rightButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
context),
child: Text(
"Ok",
style: STextStyles.button
style: STextStyles.button(
context)
.copyWith(
color: StackTheme
.instance
.color
color: Theme.of(context)
.extension<
StackColors>()!
.buttonTextSecondary,
),
),
@ -609,13 +626,15 @@ class _Step4ViewState extends ConsumerState<Step4View> {
),
);
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
buttonTitle,
style: STextStyles.button.copyWith(
color: StackTheme
.instance.color.buttonTextSecondary,
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
),
);

View file

@ -32,7 +32,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -66,7 +66,10 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
builder: (_) => WillPopScope(
onWillPop: () async => false,
child: Container(
color: StackTheme.instance.color.overlay.withOpacity(0.8),
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withOpacity(0.6),
child: const CustomLoadingOverlay(
message: "Updating exchange rate",
eventBus: null,
@ -366,8 +369,10 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
),
Text(
"You will send",
style: STextStyles.itemSubtitle.copyWith(
color: StackTheme.instance.color.textDark3,
style: STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
),
),
const SizedBox(
@ -436,7 +441,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
right: 12,
),
hintText: "0",
hintStyle: STextStyles.fieldLabel.copyWith(
hintStyle: STextStyles.fieldLabel(context).copyWith(
fontSize: 14,
),
prefixIcon: FittedBox(
@ -561,9 +566,9 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
width: 18,
height: 18,
decoration: BoxDecoration(
color: StackTheme
.instance
.color
color: Theme.of(context)
.extension<
StackColors>()!
.textFieldDefaultBG,
borderRadius:
BorderRadius.circular(
@ -586,7 +591,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
width: 18,
height: 18,
decoration: BoxDecoration(
// color: StackTheme.instance.color.accentColorDark
// color: Theme.of(context).extension<StackColors>()!.accentColorDark
borderRadius:
BorderRadius.circular(18),
),
@ -594,8 +599,9 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
Assets.svg.circleQuestion,
width: 18,
height: 18,
color: StackTheme.instance
.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
),
);
}
@ -619,9 +625,11 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
.market?.from
.toUpperCase())) ??
"-",
style: STextStyles.smallMed14.copyWith(
color: StackTheme
.instance.color.textDark,
style: STextStyles.smallMed14(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
),
const SizedBox(
@ -631,8 +639,9 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
Assets.svg.chevronDown,
width: 5,
height: 2.5,
color:
StackTheme.instance.color.textDark,
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
],
),
@ -652,27 +661,41 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
alignment: Alignment.bottomLeft,
child: Text(
"You will receive",
style: STextStyles.itemSubtitle.copyWith(
color: StackTheme.instance.color.textDark3,
style:
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
),
),
),
),
Center(
child: GestureDetector(
onTap: () async {
await _swap();
},
child: Padding(
padding: const EdgeInsets.all(4),
child: SvgPicture.asset(
Assets.svg.swap,
width: 20,
height: 20,
color:
StackTheme.instance.color.accentColorDark,
child: Column(
children: [
const SizedBox(
height: 6,
),
),
GestureDetector(
onTap: () async {
await _swap();
},
child: Padding(
padding: const EdgeInsets.all(4),
child: SvgPicture.asset(
Assets.svg.swap,
width: 20,
height: 20,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
),
),
const SizedBox(
height: 6,
),
],
),
),
Positioned.fill(
@ -687,7 +710,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
: ref.watch(fixedRateExchangeFormProvider
.select((value) =>
value.sendAmountWarning)),
style: STextStyles.errorSmall,
style: STextStyles.errorSmall(context),
),
),
),
@ -763,7 +786,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
right: 12,
),
hintText: "0",
hintStyle: STextStyles.fieldLabel.copyWith(
hintStyle: STextStyles.fieldLabel(context).copyWith(
fontSize: 14,
),
prefixIcon: FittedBox(
@ -882,9 +905,9 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
width: 18,
height: 18,
decoration: BoxDecoration(
color: StackTheme
.instance
.color
color: Theme.of(context)
.extension<
StackColors>()!
.textFieldDefaultBG,
borderRadius:
BorderRadius.circular(
@ -906,7 +929,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
width: 18,
height: 18,
decoration: BoxDecoration(
// color: StackTheme.instance.color.accentColorDark
// color: Theme.of(context).extension<StackColors>()!.accentColorDark
borderRadius:
BorderRadius.circular(18),
),
@ -914,8 +937,9 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
Assets.svg.circleQuestion,
width: 18,
height: 18,
color: StackTheme.instance
.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
),
);
}
@ -939,9 +963,11 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
.market?.to
.toUpperCase())) ??
"-",
style: STextStyles.smallMed14.copyWith(
color: StackTheme
.instance.color.textDark,
style: STextStyles.smallMed14(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
),
const SizedBox(
@ -951,8 +977,9 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
Assets.svg.chevronDown,
width: 5,
height: 2.5,
color:
StackTheme.instance.color.textDark,
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
],
),
@ -980,7 +1007,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
// Text(
// ref.watch(exchangeFormSateProvider.select(
// (value) => value.minimumReceiveWarning)),
// style: STextStyles.errorSmall,
// style: STextStyles.errorSmall(context),
// ),
// ],
// ),
@ -1139,9 +1166,11 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
.select((value) => value.canExchange))
: ref.watch(fixedRateExchangeFormProvider
.select((value) => value.canExchange)))
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
onPressed: ((ref
.read(prefsChangeNotifierProvider)
@ -1307,12 +1336,14 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
message:
"${response.value!.warningMessage!}\n\nDo you want to attempt trade anyways?",
leftButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(
context),
),
onPressed: () {
// notify return to cancel
@ -1320,12 +1351,13 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
},
),
rightButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(
context),
child: Text(
"Attempt",
style: STextStyles.button,
style: STextStyles.button(context),
),
onPressed: () {
// continue and try to attempt trade
@ -1369,7 +1401,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
: null,
child: Text(
"Exchange",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
const SizedBox(
@ -1377,8 +1409,8 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
),
// Text(
// "Trades",
// style: STextStyles.itemSubtitle.copyWith(
// color: StackTheme.instance.color.textDark3,
// style: STextStyles.itemSubtitle(context).copyWith(
// color: Theme.of(context).extension<StackColors>()!.textDark3,
// ),
// ),
// SizedBox(
@ -1417,8 +1449,10 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
),
Text(
"Trades",
style: STextStyles.itemSubtitle.copyWith(
color: StackTheme.instance.color.textDark3,
style: STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
),
),
const SizedBox(
@ -1491,7 +1525,9 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -1501,7 +1537,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
child: Text(
"Trades will appear here",
textAlign: TextAlign.center,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
),
),
@ -1533,7 +1569,7 @@ class RateInfo extends ConsumerWidget {
return Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -1611,7 +1647,7 @@ class RateInfo extends ConsumerWidget {
children: [
Text(
isEstimated ? "Estimated rate" : "Fixed rate",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
width: 6,
@ -1621,7 +1657,9 @@ class RateInfo extends ConsumerWidget {
Assets.svg.chevronDown,
width: 5,
height: 2.5,
color: StackTheme.instance.color.infoItemLabel,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemLabel,
),
],
),
@ -1638,7 +1676,7 @@ class RateInfo extends ConsumerWidget {
.select((value) => value.rateDisplayString))
: ref.watch(fixedRateExchangeFormProvider
.select((value) => value.rateDisplayString)),
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
),
),

View file

@ -16,7 +16,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/animated_text.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -60,7 +60,7 @@ class _SendFromViewState extends ConsumerState<SendFromView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -69,7 +69,7 @@ class _SendFromViewState extends ConsumerState<SendFromView> {
),
title: Text(
"Send ",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -79,14 +79,14 @@ class _SendFromViewState extends ConsumerState<SendFromView> {
children: [
Text(
"Choose your ${coin.ticker} wallet",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 8,
),
Text(
"You need to send ${amount.toStringAsFixed(coin == Coin.monero ? 12 : 8)} ${coin.ticker}",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 16,
@ -161,7 +161,7 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
return RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: MaterialButton(
splashColor: StackTheme.instance.color.highlight,
splashColor: Theme.of(context).extension<StackColors>()!.highlight,
key: Key("walletsSheetItemButtonKey_$walletId"),
padding: const EdgeInsets.all(5),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
@ -242,12 +242,15 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
title: "Transaction failed",
message: e.toString(),
rightButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Ok",
style: STextStyles.button.copyWith(
color: StackTheme.instance.color.buttonTextSecondary,
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
),
onPressed: () {
@ -264,7 +267,8 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
children: [
Container(
decoration: BoxDecoration(
color: StackTheme.instance
color: Theme.of(context)
.extension<StackColors>()!
.colorForCoin(manager.coin)
.withOpacity(0.5),
borderRadius: BorderRadius.circular(
@ -289,7 +293,7 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
children: [
Text(
manager.walletName,
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 2,
@ -305,7 +309,7 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
locale: locale,
decimalPlaces: coin == Coin.monero ? 12 : 8,
)} ${coin.ticker}",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
);
} else {
return AnimatedText(
@ -315,7 +319,7 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
"Loading balance..",
"Loading balance..."
],
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
);
}
},

View file

@ -3,7 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
enum ExchangeRateType { estimated, fixed }
@ -16,7 +16,7 @@ class ExchangeRateSheet extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
return Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(20),
),
@ -35,7 +35,8 @@ class ExchangeRateSheet extends ConsumerWidget {
Center(
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.textSubtitle4,
color:
Theme.of(context).extension<StackColors>()!.textSubtitle4,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -49,7 +50,7 @@ class ExchangeRateSheet extends ConsumerWidget {
),
Text(
"Exchange rate",
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -76,8 +77,9 @@ class ExchangeRateSheet extends ConsumerWidget {
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme
.instance.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: ExchangeRateType.estimated,
groupValue: ref.watch(prefsChangeNotifierProvider
.select((value) => value.exchangeRateType)),
@ -103,7 +105,7 @@ class ExchangeRateSheet extends ConsumerWidget {
children: [
Text(
"Estimated rate",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -111,8 +113,10 @@ class ExchangeRateSheet extends ConsumerWidget {
),
Text(
"ChangeNOW will pick the best rate for you during the moment of the exchange.",
style: STextStyles.itemSubtitle.copyWith(
color: StackTheme.instance.color.textSubtitle1,
style: STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
),
textAlign: TextAlign.left,
),
@ -147,8 +151,9 @@ class ExchangeRateSheet extends ConsumerWidget {
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme
.instance.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: ExchangeRateType.fixed,
groupValue: ref.watch(prefsChangeNotifierProvider
.select((value) => value.exchangeRateType)),
@ -171,7 +176,7 @@ class ExchangeRateSheet extends ConsumerWidget {
children: [
Text(
"Fixed rate",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -179,8 +184,10 @@ class ExchangeRateSheet extends ConsumerWidget {
),
Text(
"You will get the exact exchange amount displayed - ChangeNOW takes all the rate risks.",
style: STextStyles.itemSubtitle.copyWith(
color: StackTheme.instance.color.textSubtitle1,
style: STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
),
textAlign: TextAlign.left,
)

View file

@ -1,8 +1,8 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
enum StepIndicatorStatus { current, completed, incomplete }
@ -19,18 +19,22 @@ class StepIndicator extends StatelessWidget {
final double size;
Color get background {
Color background(BuildContext context) {
switch (status) {
case StepIndicatorStatus.current:
return StackTheme.instance.color.stepIndicatorBGNumber;
return Theme.of(context)
.extension<StackColors>()!
.stepIndicatorBGNumber;
case StepIndicatorStatus.completed:
return StackTheme.instance.color.stepIndicatorBGCheck;
return Theme.of(context).extension<StackColors>()!.stepIndicatorBGCheck;
case StepIndicatorStatus.incomplete:
return StackTheme.instance.color.stepIndicatorBGInactive;
return Theme.of(context)
.extension<StackColors>()!
.stepIndicatorBGInactive;
}
}
Widget get centered {
Widget centered(BuildContext context) {
switch (status) {
case StepIndicatorStatus.current:
return Text(
@ -38,13 +42,16 @@ class StepIndicator extends StatelessWidget {
style: GoogleFonts.roboto(
fontWeight: FontWeight.w600,
fontSize: 8,
color: StackTheme.instance.color.stepIndicatorIconNumber,
color: Theme.of(context)
.extension<StackColors>()!
.stepIndicatorIconNumber,
),
);
case StepIndicatorStatus.completed:
return SvgPicture.asset(
Assets.svg.check,
color: StackTheme.instance.color.stepIndicatorIconText,
color:
Theme.of(context).extension<StackColors>()!.stepIndicatorIconText,
width: 10,
);
case StepIndicatorStatus.incomplete:
@ -53,7 +60,9 @@ class StepIndicator extends StatelessWidget {
style: GoogleFonts.roboto(
fontWeight: FontWeight.w600,
fontSize: 8,
color: StackTheme.instance.color.stepIndicatorIconInactive,
color: Theme.of(context)
.extension<StackColors>()!
.stepIndicatorIconInactive,
),
);
}
@ -66,10 +75,10 @@ class StepIndicator extends StatelessWidget {
height: size,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(size / 2),
color: background,
color: background(context),
),
child: Center(
child: centered,
child: centered(context),
),
);
}

View file

@ -1,6 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:stackwallet/pages/exchange_view/sub_widgets/step_indicator.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class StepRow extends StatelessWidget {
const StepRow({
@ -18,15 +18,17 @@ class StepRow extends StatelessWidget {
final double indicatorSize;
final double minSpacing;
Color getColor(int index) {
Color getColor(int index, BuildContext context) {
if (current >= count - 1) {
return StackTheme.instance.color.accentColorDark;
return Theme.of(context).extension<StackColors>()!.accentColorDark;
}
if (current <= index) {
return StackTheme.instance.color.stepIndicatorBGLinesInactive;
return Theme.of(context)
.extension<StackColors>()!
.stepIndicatorBGLinesInactive;
} else {
return StackTheme.instance.color.stepIndicatorBGLines;
return Theme.of(context).extension<StackColors>()!.stepIndicatorBGLines;
}
}
@ -40,7 +42,7 @@ class StepRow extends StatelessWidget {
}
}
List<Widget> _buildList(double spacerWidth) {
List<Widget> _buildList(double spacerWidth, BuildContext context) {
List<Widget> list = [];
for (int i = 0; i < count - 1; i++) {
list.add(StepIndicator(
@ -51,7 +53,7 @@ class StepRow extends StatelessWidget {
width: spacerWidth,
dotSize: 1.5,
spacing: 4,
color: getColor(i),
color: getColor(i, context),
));
}
list.add(StepIndicator(
@ -68,7 +70,7 @@ class StepRow extends StatelessWidget {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
..._buildList(spacerWidth),
..._buildList(spacerWidth, context),
],
);
}

View file

@ -22,7 +22,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -140,9 +140,9 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
Decimal.parse("-1");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
leading: AppBarBackButton(
onPressed: () async {
Navigator.of(context).pop();
@ -150,7 +150,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
),
title: Text(
"Trade details",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -170,7 +170,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
SelectableText(
"${trade.fromCurrency.toUpperCase()}${trade.toCurrency.toUpperCase()}",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 4,
@ -180,7 +180,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
localeServiceChangeNotifierProvider
.select((value) => value.locale),
), decimalPlaces: trade.fromCurrency.toLowerCase() == "xmr" ? 12 : 8)} ${trade.fromCurrency.toUpperCase()}",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
],
),
@ -212,18 +212,21 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Text(
"Status",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 4,
),
SelectableText(
trade.statusObject?.status.name ?? trade.statusString,
style: STextStyles.itemSubtitle.copyWith(
style: STextStyles.itemSubtitle(context).copyWith(
color: trade.statusObject != null
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.colorForStatus(trade.statusObject!.status)
: StackTheme.instance.color.accentColorDark,
: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
),
// ),
@ -237,15 +240,19 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
),
if (!sentFromStack && !hasTx)
RoundedContainer(
color: StackTheme.instance.color.warningBackground,
color: Theme.of(context)
.extension<StackColors>()!
.warningBackground,
child: RichText(
text: TextSpan(
text:
"You must send at least ${sendAmount.toStringAsFixed(
trade.fromCurrency.toLowerCase() == "xmr" ? 12 : 8,
)} ${trade.fromCurrency.toUpperCase()}. ",
style: STextStyles.label.copyWith(
color: StackTheme.instance.color.accentColorDark,
style: STextStyles.label(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.warningForeground,
fontWeight: FontWeight.w700,
),
children: [
@ -256,9 +263,10 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
? 12
: 8,
)} ${trade.fromCurrency.toUpperCase()}, your transaction may not be converted and it may not be refunded.",
style: STextStyles.label.copyWith(
color:
StackTheme.instance.color.accentColorDark,
style: STextStyles.label(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.warningForeground,
fontWeight: FontWeight.w500,
),
),
@ -276,14 +284,14 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Text(
"Sent from",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 4,
),
SelectableText(
widget.walletName!,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
const SizedBox(
height: 10,
@ -301,7 +309,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
},
child: Text(
"View transaction",
style: STextStyles.link2,
style: STextStyles.link2(context),
),
),
],
@ -318,14 +326,14 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Text(
"ChangeNOW address",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 4,
),
SelectableText(
trade.payinAddress,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),
@ -341,14 +349,14 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Text(
"Send ${trade.fromCurrency.toUpperCase()} to this address",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 4,
),
SelectableText(
trade.payinAddress,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
const SizedBox(
height: 10,
@ -369,8 +377,9 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Center(
child: Text(
"Recovery phrase QR code",
style: STextStyles.pageTitleH2,
"Send ${trade.fromCurrency.toUpperCase()} to this address",
style:
STextStyles.pageTitleH2(context),
),
),
const SizedBox(
@ -385,11 +394,13 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
child: QrImage(
data: trade.payinAddress,
size: width,
backgroundColor: StackTheme
.instance.color.popupBG,
foregroundColor: StackTheme
.instance
.color
backgroundColor: Theme.of(
context)
.extension<StackColors>()!
.popupBG,
foregroundColor: Theme.of(
context)
.extension<StackColors>()!
.accentColorDark),
),
),
@ -405,16 +416,17 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
// await _capturePng(true);
Navigator.of(context).pop();
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
context),
child: Text(
"Cancel",
style: STextStyles.button
style: STextStyles.button(context)
.copyWith(
color: StackTheme
.instance
.color
color: Theme.of(context)
.extension<
StackColors>()!
.accentColorDark),
),
),
@ -429,17 +441,19 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
child: Row(
children: [
SvgPicture.asset(
Assets.svg.pencil,
width: 10,
height: 10,
color: StackTheme.instance.color.infoItemIcons,
Assets.svg.qrcode,
width: 12,
height: 12,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
const SizedBox(
width: 4,
),
Text(
"Edit",
style: STextStyles.link2,
"Show QR code",
style: STextStyles.link2(context),
),
],
),
@ -459,7 +473,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Text(
"Trade note",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
GestureDetector(
onTap: () {
@ -479,15 +493,16 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
Assets.svg.pencil,
width: 10,
height: 10,
color:
StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
const SizedBox(
width: 4,
),
Text(
"Edit",
style: STextStyles.link2,
style: STextStyles.link2(context),
),
],
),
@ -500,7 +515,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
SelectableText(
ref.watch(tradeNoteServiceProvider.select(
(value) => value.getNote(tradeId: tradeId))),
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),
@ -519,7 +534,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Text(
"Transaction note",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
GestureDetector(
onTap: () {
@ -538,15 +553,16 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
Assets.svg.pencil,
width: 10,
height: 10,
color:
StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
const SizedBox(
width: 4,
),
Text(
"Edit",
style: STextStyles.link2,
style: STextStyles.link2(context),
),
],
),
@ -570,7 +586,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
}
return SelectableText(
_note,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
);
},
),
@ -586,7 +602,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Text(
"Date",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
// Flexible(
// child: FittedBox(
@ -595,7 +611,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
SelectableText(
Format.extractDateFrom(
trade.date.millisecondsSinceEpoch ~/ 1000),
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
// ),
// ),
@ -611,7 +627,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Text(
"Exchange",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
// Flexible(
// child: FittedBox(
@ -619,7 +635,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
// child:
SelectableText(
"ChangeNOW",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
// ),
// ),
@ -634,14 +650,14 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Text(
"Trade ID",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const Spacer(),
Row(
children: [
Text(
trade.id,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
const SizedBox(
width: 10,
@ -658,7 +674,9 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
},
child: SvgPicture.asset(
Assets.svg.copy,
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
width: 12,
),
)
@ -676,7 +694,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
children: [
Text(
"Tracking",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 4,
@ -692,7 +710,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
},
child: Text(
"https://changenow.io/exchange/txs/${trade.id}",
style: STextStyles.link2,
style: STextStyles.link2(context),
),
),
],

View file

@ -29,7 +29,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
@ -81,7 +81,10 @@ class _WalletInitiatedExchangeViewState
builder: (_) => WillPopScope(
onWillPop: () async => false,
child: Container(
color: StackTheme.instance.color.accentColorDark.withOpacity(0.8),
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark
.withOpacity(0.8),
child: const CustomLoadingOverlay(
message: "Updating exchange rate",
eventBus: null,
@ -353,7 +356,7 @@ class _WalletInitiatedExchangeViewState
});
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -368,7 +371,7 @@ class _WalletInitiatedExchangeViewState
),
title: Text(
"Exchange",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -397,22 +400,24 @@ class _WalletInitiatedExchangeViewState
),
Text(
"Exchange amount",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 8,
),
Text(
"Network fees and other exchange charges are included in the rate.",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 24,
),
Text(
"You will send",
style: STextStyles.itemSubtitle.copyWith(
color: StackTheme.instance.color.textDark3,
style: STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
),
),
const SizedBox(
@ -481,7 +486,7 @@ class _WalletInitiatedExchangeViewState
right: 12,
),
hintText: "0",
hintStyle: STextStyles.fieldLabel.copyWith(
hintStyle: STextStyles.fieldLabel(context).copyWith(
fontSize: 14,
),
prefixIcon: FittedBox(
@ -621,9 +626,9 @@ class _WalletInitiatedExchangeViewState
width: 18,
height: 18,
decoration: BoxDecoration(
color: StackTheme
.instance
.color
color: Theme.of(context)
.extension<
StackColors>()!
.textSubtitle2,
borderRadius:
BorderRadius
@ -648,7 +653,7 @@ class _WalletInitiatedExchangeViewState
width: 18,
height: 18,
decoration: BoxDecoration(
// color: StackTheme.instance.color.accentColorDark
// color: Theme.of(context).extension<StackColors>()!.accentColorDark
borderRadius:
BorderRadius.circular(
18),
@ -657,8 +662,10 @@ class _WalletInitiatedExchangeViewState
Assets.svg.circleQuestion,
width: 18,
height: 18,
color: StackTheme.instance
.color.textSubtitle2,
color: Theme.of(context)
.extension<
StackColors>()!
.textSubtitle2,
),
);
}
@ -682,10 +689,11 @@ class _WalletInitiatedExchangeViewState
.market?.from
.toUpperCase())) ??
"-",
style: STextStyles.smallMed14
style: STextStyles.smallMed14(context)
.copyWith(
color: StackTheme.instance
.color.accentColorDark),
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
const SizedBox(
width: 6,
@ -712,7 +720,8 @@ class _WalletInitiatedExchangeViewState
Assets.svg.chevronDown,
width: 5,
height: 2.5,
color: StackTheme.instance.color
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark);
}),
],
@ -733,8 +742,11 @@ class _WalletInitiatedExchangeViewState
alignment: Alignment.bottomLeft,
child: Text(
"You will receive",
style: STextStyles.itemSubtitle.copyWith(
color: StackTheme.instance.color.textDark3,
style: STextStyles.itemSubtitle(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
),
),
),
@ -766,7 +778,7 @@ class _WalletInitiatedExchangeViewState
: ref.watch(fixedRateExchangeFormProvider
.select((value) =>
value.sendAmountWarning)),
style: STextStyles.errorSmall,
style: STextStyles.errorSmall(context),
),
),
),
@ -842,7 +854,7 @@ class _WalletInitiatedExchangeViewState
right: 12,
),
hintText: "0",
hintStyle: STextStyles.fieldLabel.copyWith(
hintStyle: STextStyles.fieldLabel(context).copyWith(
fontSize: 14,
),
prefixIcon: FittedBox(
@ -984,9 +996,9 @@ class _WalletInitiatedExchangeViewState
width: 18,
height: 18,
decoration: BoxDecoration(
color: StackTheme
.instance
.color
color: Theme.of(context)
.extension<
StackColors>()!
.textSubtitle2,
borderRadius:
BorderRadius
@ -1009,7 +1021,7 @@ class _WalletInitiatedExchangeViewState
width: 18,
height: 18,
decoration: BoxDecoration(
// color: StackTheme.instance.color.accentColorDark
// color: Theme.of(context).extension<StackColors>()!.accentColorDark
borderRadius:
BorderRadius.circular(
18),
@ -1018,8 +1030,10 @@ class _WalletInitiatedExchangeViewState
Assets.svg.circleQuestion,
width: 18,
height: 18,
color: StackTheme.instance
.color.textSubtitle2,
color: Theme.of(context)
.extension<
StackColors>()!
.textSubtitle2,
),
);
}
@ -1043,10 +1057,11 @@ class _WalletInitiatedExchangeViewState
.market?.to
.toUpperCase())) ??
"-",
style: STextStyles.smallMed14
style: STextStyles.smallMed14(context)
.copyWith(
color: StackTheme.instance
.color.accentColorDark),
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
const SizedBox(
width: 6,
@ -1073,7 +1088,8 @@ class _WalletInitiatedExchangeViewState
Assets.svg.chevronDown,
width: 5,
height: 2.5,
color: StackTheme.instance.color
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark);
}),
],
@ -1102,7 +1118,7 @@ class _WalletInitiatedExchangeViewState
// Text(
// ref.watch(exchangeFormSateProvider.select(
// (value) => value.minimumReceiveWarning)),
// style: STextStyles.errorSmall,
// style: STextStyles.errorSmall(context),
// ),
// ],
// ),
@ -1231,9 +1247,11 @@ class _WalletInitiatedExchangeViewState
.select((value) => value.canExchange))
: ref.watch(fixedRateExchangeFormProvider
.select((value) => value.canExchange)))
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
onPressed: ((ref
.read(prefsChangeNotifierProvider)
@ -1470,12 +1488,14 @@ class _WalletInitiatedExchangeViewState
message:
"${response.value!.warningMessage!}\n\nDo you want to attempt trade anyways?",
leftButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(
context),
),
onPressed: () {
// notify return to cancel
@ -1483,12 +1503,14 @@ class _WalletInitiatedExchangeViewState
},
),
rightButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(
context),
child: Text(
"Attempt",
style: STextStyles.button,
style:
STextStyles.button(context),
),
onPressed: () {
// continue and try to attempt trade
@ -1532,7 +1554,7 @@ class _WalletInitiatedExchangeViewState
: null,
child: Text(
"Next",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],

View file

@ -17,7 +17,7 @@ import 'package:stackwallet/services/change_now/change_now_loading_service.dart'
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -153,7 +153,7 @@ class _HomeViewState extends ConsumerState<HomeView> {
),
Text(
"My Stack",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
)
],
),
@ -170,7 +170,7 @@ class _HomeViewState extends ConsumerState<HomeView> {
key: const Key("walletsViewAlertsButton"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
ref.watch(notificationsProvider
.select((value) => value.hasUnreadNotifications))
@ -181,7 +181,9 @@ class _HomeViewState extends ConsumerState<HomeView> {
color: ref.watch(notificationsProvider
.select((value) => value.hasUnreadNotifications))
? null
: StackTheme.instance.color.topNavIconPrimary,
: Theme.of(context)
.extension<StackColors>()!
.topNavIconPrimary,
),
onPressed: () {
// reset unread state
@ -227,10 +229,12 @@ class _HomeViewState extends ConsumerState<HomeView> {
key: const Key("walletsViewSettingsButton"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
Assets.svg.gear,
color: StackTheme.instance.color.topNavIconPrimary,
color: Theme.of(context)
.extension<StackColors>()!
.topNavIconPrimary,
width: 20,
height: 20,
),
@ -245,15 +249,18 @@ class _HomeViewState extends ConsumerState<HomeView> {
],
),
body: Container(
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
child: Column(
children: [
if (Constants.enableExchange)
Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.background,
color:
Theme.of(context).extension<StackColors>()!.background,
boxShadow: [
StackTheme.instance.standardBoxShadow,
Theme.of(context)
.extension<StackColors>()!
.standardBoxShadow,
],
),
child: const Padding(

View file

@ -12,7 +12,7 @@ import 'package:stackwallet/providers/exchange/fixed_rate_market_pairs_provider.
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class HomeViewButtonBar extends ConsumerStatefulWidget {
@ -148,13 +148,15 @@ class _HomeViewButtonBarState extends ConsumerState<HomeViewButtonBar> {
Expanded(
child: TextButton(
style: selectedIndex == 0
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)!
.copyWith(
minimumSize:
MaterialStateProperty.all<Size>(const Size(46, 36)),
)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context)!
.copyWith(
minimumSize:
@ -168,11 +170,13 @@ class _HomeViewButtonBarState extends ConsumerState<HomeViewButtonBar> {
},
child: Text(
"Wallets",
style: STextStyles.button.copyWith(
style: STextStyles.button(context).copyWith(
fontSize: 14,
color: selectedIndex == 0
? StackTheme.instance.color.buttonTextPrimary
: StackTheme.instance.color.textDark,
? Theme.of(context)
.extension<StackColors>()!
.buttonTextPrimary
: Theme.of(context).extension<StackColors>()!.textDark,
),
),
),
@ -183,13 +187,15 @@ class _HomeViewButtonBarState extends ConsumerState<HomeViewButtonBar> {
Expanded(
child: TextButton(
style: selectedIndex == 1
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)!
.copyWith(
minimumSize:
MaterialStateProperty.all<Size>(const Size(46, 36)),
)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context)!
.copyWith(
minimumSize:
@ -226,11 +232,13 @@ class _HomeViewButtonBarState extends ConsumerState<HomeViewButtonBar> {
},
child: Text(
"Exchange",
style: STextStyles.button.copyWith(
style: STextStyles.button(context).copyWith(
fontSize: 14,
color: selectedIndex == 1
? StackTheme.instance.color.buttonTextPrimary
: StackTheme.instance.color.textDark,
? Theme.of(context)
.extension<StackColors>()!
.buttonTextPrimary
: Theme.of(context).extension<StackColors>()!.textDark,
),
),
),
@ -258,10 +266,10 @@ class _HomeViewButtonBarState extends ConsumerState<HomeViewButtonBar> {
// },
// child: Text(
// "Buy",
// style: STextStyles.button.copyWith(
// style: STextStyles.button(context).copyWith(
// fontSize: 14,
// color:
// selectedIndex == 2 ? CFColors.light1 : StackTheme.instance.color.accentColorDark
// selectedIndex == 2 ? CFColors.light1 : Theme.of(context).extension<StackColors>()!.accentColorDark
// ),
// ),
// ),

View file

@ -5,7 +5,7 @@ import 'package:stackwallet/pages/pinpad_views/create_pin_view.dart';
import 'package:stackwallet/pages_desktop_specific/create_password/create_password_view.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:url_launcher/url_launcher.dart';
@ -29,7 +29,7 @@ class _IntroViewState extends State<IntroView> {
Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType ");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
body: Center(
child: !isDesktop
? Column(
@ -156,8 +156,8 @@ class AppNameText extends StatelessWidget {
"Stack Wallet",
textAlign: TextAlign.center,
style: !isDesktop
? STextStyles.pageTitleH1
: STextStyles.pageTitleH1.copyWith(
? STextStyles.pageTitleH1(context)
: STextStyles.pageTitleH1(context).copyWith(
fontSize: 40,
),
);
@ -175,8 +175,8 @@ class IntroAboutText extends StatelessWidget {
"An open-source, multicoin wallet for everyone",
textAlign: TextAlign.center,
style: !isDesktop
? STextStyles.subtitle
: STextStyles.subtitle.copyWith(
? STextStyles.subtitle(context)
: STextStyles.subtitle(context).copyWith(
fontSize: 24,
),
);
@ -195,12 +195,12 @@ class PrivacyAndTOSText extends StatelessWidget {
return RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: STextStyles.label.copyWith(fontSize: fontSize),
style: STextStyles.label(context).copyWith(fontSize: fontSize),
children: [
const TextSpan(text: "By using Stack Wallet, you agree to the "),
TextSpan(
text: "Terms of service",
style: STextStyles.richLink.copyWith(fontSize: fontSize),
style: STextStyles.richLink(context).copyWith(fontSize: fontSize),
recognizer: TapGestureRecognizer()
..onTap = () {
launchUrl(
@ -212,7 +212,7 @@ class PrivacyAndTOSText extends StatelessWidget {
const TextSpan(text: " and "),
TextSpan(
text: "Privacy policy",
style: STextStyles.richLink.copyWith(fontSize: fontSize),
style: STextStyles.richLink(context).copyWith(fontSize: fontSize),
recognizer: TapGestureRecognizer()
..onTap = () {
launchUrl(
@ -236,26 +236,30 @@ class GetStartedButton extends StatelessWidget {
Widget build(BuildContext context) {
return !isDesktop
? TextButton(
style: StackTheme.instance.getPrimaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: () {
Navigator.of(context).pushNamed(CreatePinView.routeName);
},
child: Text(
"Get started",
style: STextStyles.button,
style: STextStyles.button(context),
),
)
: SizedBox(
width: 328,
height: 70,
child: TextButton(
style: StackTheme.instance.getPrimaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: () {
Navigator.of(context).pushNamed(CreatePasswordView.routeName);
},
child: Text(
"Get started",
style: STextStyles.button.copyWith(fontSize: 20),
style: STextStyles.button(context).copyWith(fontSize: 20),
),
),
);

View file

@ -3,8 +3,7 @@ import 'dart:math';
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class LoadingView extends StatelessWidget {
const LoadingView({Key? key}) : super(key: key);
@ -13,9 +12,9 @@ class LoadingView extends StatelessWidget {
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
body: Container(
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
child: Center(
child: SizedBox(
width: min(size.width, size.height) * 0.5,

View file

@ -3,7 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/managed_favorite.dart';
@ -19,7 +19,7 @@ class ManageFavoritesView extends StatelessWidget {
appBar: AppBar(
title: Text(
"Favorite wallets",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
leading: AppBarBackButton(
onPressed: () {
@ -28,7 +28,7 @@ class ManageFavoritesView extends StatelessWidget {
),
),
body: Container(
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
child: Padding(
padding: const EdgeInsets.only(
left: 12,
@ -42,7 +42,7 @@ class ManageFavoritesView extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -51,7 +51,7 @@ class ManageFavoritesView extends StatelessWidget {
padding: const EdgeInsets.all(12.0),
child: Text(
"Drag to change wallet order.",
style: STextStyles.label,
style: STextStyles.label(context),
),
),
),
@ -116,8 +116,9 @@ class ManageFavoritesView extends StatelessWidget {
),
child: Text(
"Add to favorites",
style: STextStyles.itemSubtitle12.copyWith(
color: StackTheme.instance.color.textDark3,
style: STextStyles.itemSubtitle12(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.textDark3,
),
),
),

View file

@ -4,7 +4,7 @@ import 'package:stackwallet/notifications/notification_card.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/providers/ui/unread_notifications_provider.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -44,11 +44,11 @@ class _NotificationsViewState extends ConsumerState<NotificationsView> {
.toList(growable: false);
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
title: Text(
"Notifications",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
leading: AppBarBackButton(
onPressed: () async {
@ -95,7 +95,7 @@ class _NotificationsViewState extends ConsumerState<NotificationsView> {
fit: BoxFit.scaleDown,
child: Text(
"Notifications will appear here",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
),
),

View file

@ -13,7 +13,7 @@ import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_pin_put/custom_pin_put.dart';
@ -40,9 +40,10 @@ class CreatePinView extends ConsumerStatefulWidget {
class _CreatePinViewState extends ConsumerState<CreatePinView> {
BoxDecoration get _pinPutDecoration {
return BoxDecoration(
color: StackTheme.instance.color.textSubtitle3,
border:
Border.all(width: 1, color: StackTheme.instance.color.textSubtitle3),
color: Theme.of(context).extension<StackColors>()!.textSubtitle3,
border: Border.all(
width: 1,
color: Theme.of(context).extension<StackColors>()!.textSubtitle3),
borderRadius: BorderRadius.circular(6),
);
}
@ -81,7 +82,7 @@ class _CreatePinViewState extends ConsumerState<CreatePinView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -106,14 +107,14 @@ class _CreatePinViewState extends ConsumerState<CreatePinView> {
children: [
Text(
"Create a PIN",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 8,
),
Text(
"This PIN protects access to your wallet.",
style: STextStyles.subtitle,
style: STextStyles.subtitle(context),
),
const SizedBox(
height: 36,
@ -122,7 +123,7 @@ class _CreatePinViewState extends ConsumerState<CreatePinView> {
fieldsCount: Constants.pinLength,
eachFieldHeight: 12,
eachFieldWidth: 12,
textStyle: STextStyles.label.copyWith(
textStyle: STextStyles.label(context).copyWith(
fontSize: 1,
),
focusNode: _pinPutFocusNode1,
@ -136,14 +137,19 @@ class _CreatePinViewState extends ConsumerState<CreatePinView> {
disabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
fillColor: StackTheme.instance.color.background,
fillColor:
Theme.of(context).extension<StackColors>()!.background,
counterText: "",
),
submittedFieldDecoration: _pinPutDecoration.copyWith(
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
border: Border.all(
width: 1,
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
),
selectedFieldDecoration: _pinPutDecoration,
@ -166,14 +172,14 @@ class _CreatePinViewState extends ConsumerState<CreatePinView> {
children: [
Text(
"Confirm PIN",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 8,
),
Text(
"This PIN protects access to your wallet.",
style: STextStyles.subtitle,
style: STextStyles.subtitle(context),
),
const SizedBox(
height: 36,
@ -196,14 +202,19 @@ class _CreatePinViewState extends ConsumerState<CreatePinView> {
disabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
fillColor: StackTheme.instance.color.background,
fillColor:
Theme.of(context).extension<StackColors>()!.background,
counterText: "",
),
submittedFieldDecoration: _pinPutDecoration.copyWith(
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
border: Border.all(
width: 1,
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
),
selectedFieldDecoration: _pinPutDecoration,

View file

@ -16,7 +16,7 @@ import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_pin_put/custom_pin_put.dart';
import 'package:stackwallet/widgets/shake/shake.dart';
@ -151,9 +151,10 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
BoxDecoration get _pinPutDecoration {
return BoxDecoration(
color: StackTheme.instance.color.textSubtitle2,
border:
Border.all(width: 1, color: StackTheme.instance.color.textSubtitle2),
color: Theme.of(context).extension<StackColors>()!.textSubtitle2,
border: Border.all(
width: 1,
color: Theme.of(context).extension<StackColors>()!.textSubtitle2),
borderRadius: BorderRadius.circular(6),
);
}
@ -165,7 +166,7 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
late Biometrics biometrics;
Scaffold get _body => Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: widget.showBackButton
? AppBarBackButton(
@ -197,7 +198,7 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
Center(
child: Text(
"Enter PIN",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
),
const SizedBox(
@ -207,7 +208,7 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
fieldsCount: Constants.pinLength,
eachFieldHeight: 12,
eachFieldWidth: 12,
textStyle: STextStyles.label.copyWith(
textStyle: STextStyles.label(context).copyWith(
fontSize: 1,
),
focusNode: _pinFocusNode,
@ -221,14 +222,20 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
disabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
fillColor: StackTheme.instance.color.background,
fillColor: Theme.of(context)
.extension<StackColors>()!
.background,
counterText: "",
),
submittedFieldDecoration: _pinPutDecoration.copyWith(
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
border: Border.all(
width: 1,
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
),
selectedFieldDecoration: _pinPutDecoration,

View file

@ -18,7 +18,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -101,7 +101,7 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -116,7 +116,7 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
),
title: Text(
"Generate QR code",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -141,7 +141,7 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
RoundedWhiteContainer(
child: Text(
"The new QR code with your address, amount and note will appear in the pop up window.",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
),
const SizedBox(
@ -149,7 +149,7 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
),
Text(
"Amount (Optional)",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -162,13 +162,14 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
child: TextField(
controller: amountController,
focusNode: _amountFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
keyboardType: const TextInputType.numberWithOptions(
decimal: true),
onChanged: (_) => setState(() {}),
decoration: standardInputDecoration(
"Amount",
_amountFocusNode,
context,
).copyWith(
suffixIcon: amountController.text.isNotEmpty
? Padding(
@ -197,7 +198,7 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
),
Text(
"Note (Optional)",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -210,11 +211,12 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
child: TextField(
controller: noteController,
focusNode: _noteFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
onChanged: (_) => setState(() {}),
decoration: standardInputDecoration(
"Note",
_noteFocusNode,
context,
).copyWith(
suffixIcon: noteController.text.isNotEmpty
? Padding(
@ -244,7 +246,8 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
height: 8,
),
TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: () {
final amountString = amountController.text;
@ -300,7 +303,8 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
Center(
child: Text(
"New QR code",
style: STextStyles.pageTitleH2,
style:
STextStyles.pageTitleH2(context),
),
),
const SizedBox(
@ -315,11 +319,13 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
child: QrImage(
data: uriString,
size: width,
backgroundColor: StackTheme
.instance.color.popupBG,
foregroundColor: StackTheme
.instance
.color
backgroundColor: Theme.of(
context)
.extension<StackColors>()!
.popupBG,
foregroundColor: Theme.of(
context)
.extension<StackColors>()!
.accentColorDark),
),
),
@ -335,7 +341,8 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
// TODO: add save button as well
await _capturePng(true);
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
context),
child: Row(
@ -360,7 +367,14 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
"Share",
textAlign:
TextAlign.center,
style: STextStyles.button,
style: STextStyles.button(
context)
.copyWith(
color: Theme.of(context)
.extension<
StackColors>()!
.buttonTextSecondary,
),
),
const SizedBox(
height: 2,
@ -380,7 +394,7 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
},
child: Text(
"Generate QR Code",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],

View file

@ -14,7 +14,7 @@ import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
@ -51,9 +51,15 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
builder: (_) {
return WillPopScope(
onWillPop: () async => shouldPop,
child: const CustomLoadingOverlay(
message: "Generating address",
eventBus: null,
child: Container(
color: Theme.of(context)
.extension<StackColors>()!
.overlay
.withOpacity(0.5),
child: const CustomLoadingOverlay(
message: "Generating address",
eventBus: null,
),
),
);
},
@ -110,7 +116,7 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
});
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -119,7 +125,7 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
),
title: Text(
"Receive ${coin.ticker}",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -149,7 +155,7 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
children: [
Text(
"Your ${coin.ticker} address",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const Spacer(),
Row(
@ -158,15 +164,16 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
Assets.svg.copy,
width: 10,
height: 10,
color:
StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
const SizedBox(
width: 4,
),
Text(
"Copy",
style: STextStyles.link2,
style: STextStyles.link2(context),
),
],
),
@ -180,7 +187,7 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
Expanded(
child: Text(
receivingAddress,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
),
],
@ -196,12 +203,15 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
if (coin != Coin.epicCash)
TextButton(
onPressed: generateNewAddress,
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Generate new address",
style: STextStyles.button.copyWith(
color: StackTheme.instance.color.accentColorDark),
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
const SizedBox(
@ -216,8 +226,9 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
QrImage(
data: "${coin.uriScheme}:$receivingAddress",
size: MediaQuery.of(context).size.width / 2,
foregroundColor:
StackTheme.instance.color.accentColorDark),
foregroundColor: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
const SizedBox(
height: 20,
),

View file

@ -15,7 +15,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -111,12 +111,15 @@ class _ConfirmTransactionViewState
title: "Broadcast transaction failed",
message: e.toString(),
rightButton: TextButton(
style:
StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Ok",
style: STextStyles.button
.copyWith(color: StackTheme.instance.color.accentColorDark),
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
onPressed: () {
Navigator.of(context).pop();
@ -142,7 +145,7 @@ class _ConfirmTransactionViewState
.select((value) => value.getManagerProvider(walletId)));
return Scaffold(
appBar: AppBar(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
leading: AppBarBackButton(
onPressed: () async {
// if (FocusScope.of(context).hasFocus) {
@ -154,7 +157,7 @@ class _ConfirmTransactionViewState
),
title: Text(
"Confirm transaction",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -178,7 +181,7 @@ class _ConfirmTransactionViewState
children: [
Text(
"Send ${ref.watch(managerProvider.select((value) => value.coin)).ticker}",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 12,
@ -189,14 +192,14 @@ class _ConfirmTransactionViewState
children: [
Text(
"Recipient",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 4,
),
Text(
"${transactionInfo["address"] ?? "ERROR"}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),
@ -210,7 +213,7 @@ class _ConfirmTransactionViewState
children: [
Text(
"Amount",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
Text(
"${Format.satoshiAmountToPrettyString(
@ -223,7 +226,7 @@ class _ConfirmTransactionViewState
managerProvider
.select((value) => value.coin),
).ticker}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
textAlign: TextAlign.right,
),
],
@ -238,7 +241,7 @@ class _ConfirmTransactionViewState
children: [
Text(
"Transaction fee",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
Text(
"${Format.satoshiAmountToPrettyString(
@ -251,7 +254,7 @@ class _ConfirmTransactionViewState
managerProvider
.select((value) => value.coin),
).ticker}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
textAlign: TextAlign.right,
),
],
@ -266,14 +269,14 @@ class _ConfirmTransactionViewState
children: [
Text(
"Note",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 4,
),
Text(
transactionInfo["note"] as String,
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
],
),
@ -283,13 +286,15 @@ class _ConfirmTransactionViewState
height: 12,
),
RoundedContainer(
color: StackTheme.instance.color.snackBarBackSuccess,
color: Theme.of(context)
.extension<StackColors>()!
.snackBarBackSuccess,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Total amount",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
Text(
"${Format.satoshiAmountToPrettyString(
@ -303,7 +308,7 @@ class _ConfirmTransactionViewState
managerProvider
.select((value) => value.coin),
).ticker}",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
textAlign: TextAlign.right,
),
],
@ -313,7 +318,9 @@ class _ConfirmTransactionViewState
height: 16,
),
TextButton(
style: StackTheme.instance.getPrimaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: () async {
final unlocked = await Navigator.push(
context,
@ -342,7 +349,7 @@ class _ConfirmTransactionViewState
},
child: Text(
"Send",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],

View file

@ -9,6 +9,7 @@ import 'package:stackwallet/models/send_view_auto_fill_data.dart';
import 'package:stackwallet/pages/address_book_views/address_book_view.dart';
import 'package:stackwallet/pages/send_view/confirm_transaction_view.dart';
import 'package:stackwallet/pages/send_view/sub_widgets/building_transaction_dialog.dart';
import 'package:stackwallet/pages/send_view/sub_widgets/firo_balance_selection_sheet.dart';
import 'package:stackwallet/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/providers/ui/fee_rate_type_state_provider.dart';
@ -27,7 +28,7 @@ import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/animated_text.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
@ -39,8 +40,6 @@ import 'package:stackwallet/widgets/stack_dialog.dart';
import 'package:stackwallet/widgets/stack_text_field.dart';
import 'package:stackwallet/widgets/textfield_icon_button.dart';
import 'sub_widgets/firo_balance_selection_sheet.dart';
class SendView extends ConsumerStatefulWidget {
const SendView({
Key? key,
@ -360,7 +359,7 @@ class _SendViewState extends ConsumerState<SendView> {
}
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -375,7 +374,7 @@ class _SendViewState extends ConsumerState<SendView> {
),
title: Text(
"Send ${coin.ticker}",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -400,7 +399,9 @@ class _SendViewState extends ConsumerState<SendView> {
children: [
Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -419,10 +420,14 @@ class _SendViewState extends ConsumerState<SendView> {
),
if (coin != Coin.firo &&
coin != Coin.firoTestNet)
Text(
ref.watch(provider
.select((value) => value.walletName)),
style: STextStyles.titleBold12,
Expanded(
child: Text(
ref.watch(provider
.select((value) => value.walletName)),
style: STextStyles.titleBold12(context),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
),
if (coin == Coin.firo ||
coin == Coin.firoTestNet)
@ -433,7 +438,7 @@ class _SendViewState extends ConsumerState<SendView> {
Text(
ref.watch(provider.select(
(value) => value.walletName)),
style: STextStyles.titleBold12
style: STextStyles.titleBold12(context)
.copyWith(fontSize: 14),
),
// const SizedBox(
@ -441,12 +446,19 @@ class _SendViewState extends ConsumerState<SendView> {
// ),
Text(
"${ref.watch(publicPrivateBalanceStateProvider.state).state} balance",
style: STextStyles.label
style: STextStyles.label(context)
.copyWith(fontSize: 10),
),
],
),
const Spacer(),
if (coin != Coin.firo &&
coin != Coin.firoTestNet)
const SizedBox(
width: 10,
),
if (coin == Coin.firo ||
coin == Coin.firoTestNet)
const Spacer(),
FutureBuilder(
future: (coin != Coin.firo &&
coin != Coin.firoTestNet)
@ -491,7 +503,8 @@ class _SendViewState extends ConsumerState<SendView> {
locale: locale,
decimalPlaces: 8,
)} ${coin.ticker}",
style: STextStyles.titleBold12
style: STextStyles.titleBold12(
context)
.copyWith(
fontSize: 10,
),
@ -510,7 +523,8 @@ class _SendViewState extends ConsumerState<SendView> {
locale: locale,
decimalPlaces: 2,
)} ${ref.watch(prefsChangeNotifierProvider.select((value) => value.currency))}",
style: STextStyles.titleBold12
style: STextStyles.titleBold12(
context)
.copyWith(
fontSize: 8,
fontWeight: FontWeight.w400,
@ -533,7 +547,8 @@ class _SendViewState extends ConsumerState<SendView> {
"Loading balance.. ",
"Loading balance...",
],
style: STextStyles.itemSubtitle
style: STextStyles.itemSubtitle(
context)
.copyWith(
fontSize: 10,
),
@ -548,7 +563,8 @@ class _SendViewState extends ConsumerState<SendView> {
"Loading balance.. ",
"Loading balance...",
],
style: STextStyles.itemSubtitle
style: STextStyles.itemSubtitle(
context)
.copyWith(
fontSize: 8,
),
@ -567,7 +583,7 @@ class _SendViewState extends ConsumerState<SendView> {
),
Text(
"Send to",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -603,10 +619,11 @@ class _SendViewState extends ConsumerState<SendView> {
});
},
focusNode: _addressFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Enter ${coin.ticker} address",
_addressFocusNode,
context,
).copyWith(
contentPadding: const EdgeInsets.only(
left: 16,
@ -839,9 +856,10 @@ class _SendViewState extends ConsumerState<SendView> {
child: Text(
error,
textAlign: TextAlign.left,
style: STextStyles.label.copyWith(
color:
StackTheme.instance.color.textError,
style: STextStyles.label(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textError,
),
),
),
@ -856,7 +874,7 @@ class _SendViewState extends ConsumerState<SendView> {
if (coin == Coin.firo)
Text(
"Send from",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
if (coin == Coin.firo)
@ -875,8 +893,9 @@ class _SendViewState extends ConsumerState<SendView> {
horizontal: 12,
),
child: RawMaterialButton(
splashColor:
StackTheme.instance.color.highlight,
splashColor: Theme.of(context)
.extension<StackColors>()!
.highlight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
@ -904,7 +923,8 @@ class _SendViewState extends ConsumerState<SendView> {
children: [
Text(
"${ref.watch(publicPrivateBalanceStateProvider.state).state} balance",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(
context),
),
const SizedBox(
width: 10,
@ -942,7 +962,8 @@ class _SendViewState extends ConsumerState<SendView> {
return Text(
"$_privateBalanceString ${coin.ticker}",
style:
STextStyles.itemSubtitle,
STextStyles.itemSubtitle(
context),
);
} else if (ref
.read(
@ -955,7 +976,8 @@ class _SendViewState extends ConsumerState<SendView> {
return Text(
"$_publicBalanceString ${coin.ticker}",
style:
STextStyles.itemSubtitle,
STextStyles.itemSubtitle(
context),
);
} else {
return AnimatedText(
@ -966,7 +988,8 @@ class _SendViewState extends ConsumerState<SendView> {
"Loading balance...",
],
style:
STextStyles.itemSubtitle,
STextStyles.itemSubtitle(
context),
);
}
},
@ -977,8 +1000,9 @@ class _SendViewState extends ConsumerState<SendView> {
Assets.svg.chevronDown,
width: 8,
height: 4,
color: StackTheme
.instance.color.textSubtitle2,
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle2,
),
],
),
@ -994,7 +1018,7 @@ class _SendViewState extends ConsumerState<SendView> {
children: [
Text(
"Amount",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
BlueTextButton(
@ -1059,7 +1083,7 @@ class _SendViewState extends ConsumerState<SendView> {
right: 12,
),
hintText: "0",
hintStyle: STextStyles.fieldLabel.copyWith(
hintStyle: STextStyles.fieldLabel(context).copyWith(
fontSize: 14,
),
prefixIcon: FittedBox(
@ -1068,9 +1092,11 @@ class _SendViewState extends ConsumerState<SendView> {
padding: const EdgeInsets.all(12),
child: Text(
coin.ticker,
style: STextStyles.smallMed14.copyWith(
color: StackTheme
.instance.color.accentColorDark),
style: STextStyles.smallMed14(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
),
@ -1160,7 +1186,7 @@ class _SendViewState extends ConsumerState<SendView> {
right: 12,
),
hintText: "0",
hintStyle: STextStyles.fieldLabel.copyWith(
hintStyle: STextStyles.fieldLabel(context).copyWith(
fontSize: 14,
),
prefixIcon: FittedBox(
@ -1170,9 +1196,11 @@ class _SendViewState extends ConsumerState<SendView> {
child: Text(
ref.watch(prefsChangeNotifierProvider
.select((value) => value.currency)),
style: STextStyles.smallMed14.copyWith(
color: StackTheme
.instance.color.accentColorDark),
style: STextStyles.smallMed14(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
),
@ -1183,7 +1211,7 @@ class _SendViewState extends ConsumerState<SendView> {
),
Text(
"Note (optional)",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -1196,11 +1224,12 @@ class _SendViewState extends ConsumerState<SendView> {
child: TextField(
controller: noteController,
focusNode: _noteFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
onChanged: (_) => setState(() {}),
decoration: standardInputDecoration(
"Type something...",
_noteFocusNode,
context,
).copyWith(
suffixIcon: noteController.text.isNotEmpty
? Padding(
@ -1229,7 +1258,7 @@ class _SendViewState extends ConsumerState<SendView> {
),
Text(
"Transaction fee (estimated)",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -1247,8 +1276,9 @@ class _SendViewState extends ConsumerState<SendView> {
horizontal: 12,
),
child: RawMaterialButton(
splashColor:
StackTheme.instance.color.highlight,
splashColor: Theme.of(context)
.extension<StackColors>()!
.highlight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
@ -1301,7 +1331,8 @@ class _SendViewState extends ConsumerState<SendView> {
return Text(
"~${snapshot.data! as String} ${coin.ticker}",
style:
STextStyles.itemSubtitle,
STextStyles.itemSubtitle(
context),
);
} else {
return AnimatedText(
@ -1312,7 +1343,8 @@ class _SendViewState extends ConsumerState<SendView> {
"Calculating...",
],
style:
STextStyles.itemSubtitle,
STextStyles.itemSubtitle(
context),
);
}
},
@ -1333,7 +1365,8 @@ class _SendViewState extends ConsumerState<SendView> {
.state
.prettyName,
style:
STextStyles.itemSubtitle12,
STextStyles.itemSubtitle12(
context),
),
const SizedBox(
width: 10,
@ -1348,7 +1381,8 @@ class _SendViewState extends ConsumerState<SendView> {
return Text(
"~${snapshot.data! as String} ${coin.ticker}",
style: STextStyles
.itemSubtitle,
.itemSubtitle(
context),
);
} else {
return AnimatedText(
@ -1359,7 +1393,8 @@ class _SendViewState extends ConsumerState<SendView> {
"Calculating...",
],
style: STextStyles
.itemSubtitle,
.itemSubtitle(
context),
);
}
},
@ -1370,8 +1405,9 @@ class _SendViewState extends ConsumerState<SendView> {
Assets.svg.chevronDown,
width: 8,
height: 4,
color: StackTheme
.instance.color.textSubtitle2,
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle2,
),
],
),
@ -1411,16 +1447,17 @@ class _SendViewState extends ConsumerState<SendView> {
message:
"Sending to self is currently disabled",
rightButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
context),
child: Text(
"Ok",
style: STextStyles.button
style: STextStyles.button(context)
.copyWith(
color: StackTheme
.instance
.color
color: Theme.of(context)
.extension<
StackColors>()!
.accentColorDark),
),
onPressed: () {
@ -1475,16 +1512,17 @@ class _SendViewState extends ConsumerState<SendView> {
message:
"You are about to send your entire balance. Would you like to continue?",
leftButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
context),
child: Text(
"Cancel",
style: STextStyles.button
style: STextStyles.button(context)
.copyWith(
color: StackTheme
.instance
.color
color: Theme.of(context)
.extension<
StackColors>()!
.accentColorDark),
),
onPressed: () {
@ -1492,12 +1530,14 @@ class _SendViewState extends ConsumerState<SendView> {
},
),
rightButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(
context),
child: Text(
"Yes",
style: STextStyles.button,
style:
STextStyles.button(context),
),
onPressed: () {
Navigator.of(context).pop(true);
@ -1599,16 +1639,18 @@ class _SendViewState extends ConsumerState<SendView> {
title: "Transaction failed",
message: e.toString(),
rightButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(
context),
child: Text(
"Ok",
style: STextStyles.button
style: STextStyles.button(
context)
.copyWith(
color: StackTheme
.instance
.color
color: Theme.of(context)
.extension<
StackColors>()!
.accentColorDark),
),
onPressed: () {
@ -1625,13 +1667,15 @@ class _SendViewState extends ConsumerState<SendView> {
style: ref
.watch(previewTxButtonStateProvider.state)
.state
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
child: Text(
"Preview",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
const SizedBox(

View file

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class BuildingTransactionDialog extends StatefulWidget {
@ -62,16 +62,18 @@ class _RestoringDialogState extends State<BuildingTransactionDialog>
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context).extension<StackColors>()!.accentColorDark,
width: 24,
height: 24,
),
),
rightButton: TextButton(
style: StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
onPressed: () {
Navigator.of(context).pop();

View file

@ -7,7 +7,7 @@ import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/animated_text.dart';
class FiroBalanceSelectionSheet extends ConsumerStatefulWidget {
@ -50,7 +50,7 @@ class _FiroBalanceSelectionSheetState
return Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(20),
),
@ -69,7 +69,9 @@ class _FiroBalanceSelectionSheetState
Center(
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -86,7 +88,7 @@ class _FiroBalanceSelectionSheetState
children: [
Text(
"Select balance",
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -114,8 +116,9 @@ class _FiroBalanceSelectionSheetState
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme
.instance.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: "Private",
groupValue: ref
.watch(
@ -144,7 +147,7 @@ class _FiroBalanceSelectionSheetState
// children: [
Text(
"Private balance",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -159,14 +162,14 @@ class _FiroBalanceSelectionSheetState
snapshot.hasData) {
return Text(
"${snapshot.data!} ${manager.coin.ticker}",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
textAlign: TextAlign.left,
);
} else {
return AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
);
}
},
@ -204,8 +207,9 @@ class _FiroBalanceSelectionSheetState
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme
.instance.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: "Public",
groupValue: ref
.watch(
@ -233,7 +237,7 @@ class _FiroBalanceSelectionSheetState
// children: [
Text(
"Public balance",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -248,14 +252,14 @@ class _FiroBalanceSelectionSheetState
snapshot.hasData) {
return Text(
"${snapshot.data!} ${manager.coin.ticker}",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
textAlign: TextAlign.left,
);
} else {
return AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
);
}
},

View file

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class SendingTransactionDialog extends StatefulWidget {
@ -55,7 +55,7 @@ class _RestoringDialogState extends State<SendingTransactionDialog>
turns: _spinAnimation,
child: SvgPicture.asset(
Assets.svg.arrowRotate,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context).extension<StackColors>()!.accentColorDark,
width: 24,
height: 24,
),

View file

@ -11,7 +11,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/animated_text.dart';
final feeSheetSessionCacheProvider =
@ -163,7 +163,7 @@ class _TransactionFeeSelectionSheetState
return Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(20),
),
@ -182,7 +182,9 @@ class _TransactionFeeSelectionSheetState
Center(
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -207,7 +209,7 @@ class _TransactionFeeSelectionSheetState
children: [
Text(
"Fee rate",
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -235,8 +237,9 @@ class _TransactionFeeSelectionSheetState
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme
.instance.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: FeeRateType.fast,
groupValue: ref
.watch(feeRateTypeStateProvider.state)
@ -263,7 +266,7 @@ class _TransactionFeeSelectionSheetState
children: [
Text(
FeeRateType.fast.prettyName,
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -273,7 +276,8 @@ class _TransactionFeeSelectionSheetState
AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style:
STextStyles.itemSubtitle(context),
),
if (feeObject != null)
FutureBuilder(
@ -295,14 +299,16 @@ class _TransactionFeeSelectionSheetState
snapshot.hasData) {
return Text(
"(~${snapshot.data!} ${manager.coin.ticker})",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(
context),
textAlign: TextAlign.left,
);
} else {
return AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(
context),
);
}
},
@ -316,7 +322,7 @@ class _TransactionFeeSelectionSheetState
AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
if (feeObject != null)
Text(
@ -325,7 +331,7 @@ class _TransactionFeeSelectionSheetState
manager.coin),
feeObject!.numberOfBlocksFast,
),
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
textAlign: TextAlign.left,
),
],
@ -359,8 +365,9 @@ class _TransactionFeeSelectionSheetState
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme
.instance.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: FeeRateType.average,
groupValue: ref
.watch(feeRateTypeStateProvider.state)
@ -386,7 +393,7 @@ class _TransactionFeeSelectionSheetState
children: [
Text(
FeeRateType.average.prettyName,
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -396,7 +403,8 @@ class _TransactionFeeSelectionSheetState
AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style:
STextStyles.itemSubtitle(context),
),
if (feeObject != null)
FutureBuilder(
@ -418,14 +426,16 @@ class _TransactionFeeSelectionSheetState
snapshot.hasData) {
return Text(
"(~${snapshot.data!} ${manager.coin.ticker})",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(
context),
textAlign: TextAlign.left,
);
} else {
return AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(
context),
);
}
},
@ -439,7 +449,7 @@ class _TransactionFeeSelectionSheetState
AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
if (feeObject != null)
Text(
@ -448,7 +458,7 @@ class _TransactionFeeSelectionSheetState
manager.coin),
feeObject!.numberOfBlocksAverage,
),
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
textAlign: TextAlign.left,
),
],
@ -482,8 +492,9 @@ class _TransactionFeeSelectionSheetState
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme
.instance.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: FeeRateType.slow,
groupValue: ref
.watch(feeRateTypeStateProvider.state)
@ -510,7 +521,7 @@ class _TransactionFeeSelectionSheetState
children: [
Text(
FeeRateType.slow.prettyName,
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -520,7 +531,8 @@ class _TransactionFeeSelectionSheetState
AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style:
STextStyles.itemSubtitle(context),
),
if (feeObject != null)
FutureBuilder(
@ -542,14 +554,16 @@ class _TransactionFeeSelectionSheetState
snapshot.hasData) {
return Text(
"(~${snapshot.data!} ${manager.coin.ticker})",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(
context),
textAlign: TextAlign.left,
);
} else {
return AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(
context),
);
}
},
@ -563,7 +577,7 @@ class _TransactionFeeSelectionSheetState
AnimatedText(
stringsToLoopThrough:
stringsToLoopThrough,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
if (feeObject != null)
Text(
@ -572,7 +586,7 @@ class _TransactionFeeSelectionSheetState
manager.coin),
feeObject!.numberOfBlocksSlow,
),
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
textAlign: TextAlign.left,
),
],

View file

@ -10,7 +10,7 @@ import 'package:lelantus/git_versions.dart' as FIRO_VERSIONS;
import 'package:package_info_plus/package_info_plus.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -118,7 +118,7 @@ class AboutView extends ConsumerWidget {
Future commitMoneroFuture = Future.wait(futureMoneroList);
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -127,7 +127,7 @@ class AboutView extends ConsumerWidget {
),
title: Text(
"About",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -167,7 +167,7 @@ class AboutView extends ConsumerWidget {
Center(
child: Text(
appName,
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
),
),
const SizedBox(
@ -180,14 +180,14 @@ class AboutView extends ConsumerWidget {
children: [
Text(
"Version",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 4,
),
SelectableText(
version,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
],
),
@ -202,14 +202,14 @@ class AboutView extends ConsumerWidget {
children: [
Text(
"Build number",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 4,
),
SelectableText(
build,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
],
),
@ -224,14 +224,14 @@ class AboutView extends ConsumerWidget {
children: [
Text(
"Build signature",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 4,
),
SelectableText(
signature,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
],
),
@ -264,25 +264,28 @@ class AboutView extends ConsumerWidget {
}
}
TextStyle indicationStyle =
STextStyles.itemSubtitle;
STextStyles.itemSubtitle(context);
switch (stateOfCommit) {
case CommitStatus.isHead:
indicationStyle = STextStyles.itemSubtitle
.copyWith(
color: StackTheme
.instance.color.accentColorGreen);
indicationStyle =
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorGreen);
break;
case CommitStatus.isOldCommit:
indicationStyle = STextStyles.itemSubtitle
.copyWith(
color: StackTheme
.instance.color.accentColorYellow);
indicationStyle =
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorYellow);
break;
case CommitStatus.notACommit:
indicationStyle = STextStyles.itemSubtitle
.copyWith(
color: StackTheme
.instance.color.accentColorRed);
indicationStyle =
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorRed);
break;
default:
break;
@ -293,7 +296,7 @@ class AboutView extends ConsumerWidget {
children: [
Text(
"Firo Build Commit",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 4,
@ -330,25 +333,28 @@ class AboutView extends ConsumerWidget {
}
}
TextStyle indicationStyle =
STextStyles.itemSubtitle;
STextStyles.itemSubtitle(context);
switch (stateOfCommit) {
case CommitStatus.isHead:
indicationStyle = STextStyles.itemSubtitle
.copyWith(
color: StackTheme
.instance.color.accentColorGreen);
indicationStyle =
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorGreen);
break;
case CommitStatus.isOldCommit:
indicationStyle = STextStyles.itemSubtitle
.copyWith(
color: StackTheme
.instance.color.accentColorYellow);
indicationStyle =
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorYellow);
break;
case CommitStatus.notACommit:
indicationStyle = STextStyles.itemSubtitle
.copyWith(
color: StackTheme
.instance.color.accentColorRed);
indicationStyle =
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorRed);
break;
default:
break;
@ -359,7 +365,7 @@ class AboutView extends ConsumerWidget {
children: [
Text(
"Epic Cash Build Commit",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 4,
@ -396,25 +402,28 @@ class AboutView extends ConsumerWidget {
}
}
TextStyle indicationStyle =
STextStyles.itemSubtitle;
STextStyles.itemSubtitle(context);
switch (stateOfCommit) {
case CommitStatus.isHead:
indicationStyle = STextStyles.itemSubtitle
.copyWith(
color: StackTheme
.instance.color.accentColorGreen);
indicationStyle =
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorGreen);
break;
case CommitStatus.isOldCommit:
indicationStyle = STextStyles.itemSubtitle
.copyWith(
color: StackTheme
.instance.color.accentColorYellow);
indicationStyle =
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorYellow);
break;
case CommitStatus.notACommit:
indicationStyle = STextStyles.itemSubtitle
.copyWith(
color: StackTheme
.instance.color.accentColorRed);
indicationStyle =
STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorRed);
break;
default:
break;
@ -425,7 +434,7 @@ class AboutView extends ConsumerWidget {
children: [
Text(
"Monero Build Commit",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 4,
@ -447,7 +456,7 @@ class AboutView extends ConsumerWidget {
children: [
Text(
"Website",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
const SizedBox(
height: 4,
@ -471,14 +480,14 @@ class AboutView extends ConsumerWidget {
RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: STextStyles.label,
style: STextStyles.label(context),
children: [
const TextSpan(
text:
"By using Stack Wallet, you agree to the "),
TextSpan(
text: "Terms of service",
style: STextStyles.richLink,
style: STextStyles.richLink(context),
recognizer: TapGestureRecognizer()
..onTap = () {
launchUrl(
@ -491,7 +500,7 @@ class AboutView extends ConsumerWidget {
const TextSpan(text: " and "),
TextSpan(
text: "Privacy policy",
style: STextStyles.richLink,
style: STextStyles.richLink(context),
recognizer: TapGestureRecognizer()
..onTap = () {
launchUrl(

View file

@ -4,7 +4,7 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_v
import 'package:stackwallet/providers/global/prefs_provider.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -21,7 +21,7 @@ class AdvancedSettingsView extends StatelessWidget {
debugPrint("BUILD: $runtimeType");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -30,7 +30,7 @@ class AdvancedSettingsView extends StatelessWidget {
),
title: Text(
"Advanced",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -41,7 +41,7 @@ class AdvancedSettingsView extends StatelessWidget {
RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
@ -60,7 +60,7 @@ class AdvancedSettingsView extends StatelessWidget {
children: [
Text(
"Debug info",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
],
@ -75,7 +75,7 @@ class AdvancedSettingsView extends StatelessWidget {
child: Consumer(
builder: (_, ref, __) {
return RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
@ -90,7 +90,7 @@ class AdvancedSettingsView extends StatelessWidget {
children: [
Text(
"Toggle testnet coins",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
SizedBox(

View file

@ -15,7 +15,7 @@ import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
@ -90,7 +90,7 @@ class _DebugViewState extends ConsumerState<DebugView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -99,7 +99,7 @@ class _DebugViewState extends ConsumerState<DebugView> {
),
title: Text(
"Debug",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
actions: [
Padding(
@ -114,10 +114,12 @@ class _DebugViewState extends ConsumerState<DebugView> {
key: const Key("deleteLogsAppBarButtonKey"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
Assets.svg.trash,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 20,
height: 20,
),
@ -129,22 +131,24 @@ class _DebugViewState extends ConsumerState<DebugView> {
message:
"You are about to delete all logs permanently. Are you sure?",
leftButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Cancel",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
onPressed: () {
Navigator.of(context).pop();
},
),
rightButton: TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Delete logs",
style: STextStyles.button,
style: STextStyles.button(context),
),
onPressed: () async {
Navigator.of(context).pop();
@ -167,6 +171,9 @@ class _DebugViewState extends ConsumerState<DebugView> {
await ref
.read(debugServiceProvider)
.deleteAllMessages();
await ref
.read(debugServiceProvider)
.updateRecentLogs();
shouldPop = true;
@ -215,10 +222,11 @@ class _DebugViewState extends ConsumerState<DebugView> {
onChanged: (newString) {
setState(() => _searchTerm = newString);
},
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Search",
_searchFocusNode,
context,
).copyWith(
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(
@ -372,14 +380,18 @@ class _DebugViewState extends ConsumerState<DebugView> {
return Container(
key: Key("log_${log.id}_${log.timestampInMillisUTC}"),
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
borderRadius: _borderRadius(index, logs.length),
),
child: Padding(
padding: const EdgeInsets.all(4),
child: RoundedContainer(
padding: const EdgeInsets.all(0),
color: StackTheme.instance.color.popupBG,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -387,30 +399,35 @@ class _DebugViewState extends ConsumerState<DebugView> {
children: [
Text(
" [${log.logLevel.name}]",
style: STextStyles.baseXS.copyWith(
style: STextStyles.baseXS(context)
.copyWith(
fontSize: 8,
color: (log.logLevel == LogLevel.Info
? StackTheme.instance.color
.accentColorGreen
? Theme.of(context)
.extension<StackColors>()!
.topNavIconGreen
: (log.logLevel ==
LogLevel.Warning
? StackTheme.instance.color
.accentColorYellow
? Theme.of(context)
.extension<StackColors>()!
.topNavIconYellow
: (log.logLevel ==
LogLevel.Error
? Colors.orange
: StackTheme
.instance
.color
.accentColorRed))),
: Theme.of(context)
.extension<
StackColors>()!
.topNavIconRed))),
),
),
Text(
"[${DateTime.fromMillisecondsSinceEpoch(log.timestampInMillisUTC, isUtc: true)}]: ",
style: STextStyles.baseXS.copyWith(
style: STextStyles.baseXS(context)
.copyWith(
fontSize: 8,
color: StackTheme
.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
),
),
],
@ -429,7 +446,7 @@ class _DebugViewState extends ConsumerState<DebugView> {
children: [
SelectableText(
log.message,
style: STextStyles.baseXS
style: STextStyles.baseXS(context)
.copyWith(fontSize: 8),
),
],

View file

@ -2,10 +2,13 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/hive/db.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/color_theme.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/dark_colors.dart';
import 'package:stackwallet/utilities/theme/light_colors.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -18,7 +21,7 @@ class AppearanceSettingsView extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -27,7 +30,7 @@ class AppearanceSettingsView extends ConsumerWidget {
),
title: Text(
"Appearance",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -47,7 +50,9 @@ class AppearanceSettingsView extends ConsumerWidget {
child: Consumer(
builder: (_, ref, __) {
return RawMaterialButton(
splashColor: StackTheme.instance.color.highlight,
splashColor: Theme.of(context)
.extension<StackColors>()!
.highlight,
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
@ -65,7 +70,7 @@ class AppearanceSettingsView extends ConsumerWidget {
children: [
Text(
"Display favorite wallets",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
SizedBox(
@ -98,7 +103,9 @@ class AppearanceSettingsView extends ConsumerWidget {
child: Consumer(
builder: (_, ref, __) {
return RawMaterialButton(
splashColor: StackTheme.instance.color.highlight,
splashColor: Theme.of(context)
.extension<StackColors>()!
.highlight,
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
@ -109,26 +116,15 @@ class AppearanceSettingsView extends ConsumerWidget {
onPressed: null,
child: Padding(
padding:
const EdgeInsets.symmetric(vertical: 2),
const EdgeInsets.symmetric(vertical: 8),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"Enabled dark mode",
style: STextStyles.titleBold12,
textAlign: TextAlign.left,
),
Text(
"Requires restart",
style: STextStyles.itemSubtitle,
textAlign: TextAlign.left,
),
],
Text(
"Enable dark mode",
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
SizedBox(
height: 20,
@ -148,6 +144,13 @@ class AppearanceSettingsView extends ConsumerWidget {
: ThemeType.light)
.name,
);
ref
.read(colorThemeProvider.state)
.state =
StackColors.fromStackColorTheme(
newValue
? DarkColors()
: LightColors());
},
),
)

View file

@ -6,7 +6,7 @@ import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
@ -101,7 +101,7 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
}
currenciesWithoutSelected = _filtered();
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -116,7 +116,7 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
),
title: Text(
"Currency",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -145,10 +145,11 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
onChanged: (newString) {
setState(() => filter = newString);
},
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Search",
_searchFocusNode,
context,
).copyWith(
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(
@ -203,7 +204,9 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
(context, index) {
return Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
borderRadius: _borderRadius(index),
),
child: Padding(
@ -213,8 +216,12 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
child: RoundedContainer(
padding: const EdgeInsets.all(0),
color: currenciesWithoutSelected[index] == current
? StackTheme.instance.color.currencyListItemBG
: StackTheme.instance.color.popupBG,
? Theme.of(context)
.extension<StackColors>()!
.currencyListItemBG
: Theme.of(context)
.extension<StackColors>()!
.popupBG,
child: RawMaterialButton(
onPressed: () async {
onTap(index);
@ -234,7 +241,8 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme.instance.color
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
@ -262,7 +270,8 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
? const Key(
"selectedCurrencySettingsCurrencyText")
: null,
style: STextStyles.largeMedium14,
style: STextStyles.largeMedium14(
context),
),
const SizedBox(
height: 2,
@ -280,7 +289,8 @@ class _CurrencyViewState extends ConsumerState<BaseCurrencySettingsView> {
? const Key(
"selectedCurrencySettingsCurrencyTextDescription")
: null,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(
context),
),
],
),

View file

@ -16,7 +16,7 @@ import 'package:stackwallet/pages/settings_views/sub_widgets/settings_list_butto
import 'package:stackwallet/route_generator.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -31,7 +31,7 @@ class GlobalSettingsView extends StatelessWidget {
Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -40,7 +40,7 @@ class GlobalSettingsView extends StatelessWidget {
),
title: Text(
"Settings",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: LayoutBuilder(
@ -231,12 +231,12 @@ class GlobalSettingsView extends StatelessWidget {
// ?.copyWith(
// backgroundColor:
// MaterialStateProperty.all<Color>(
// StackTheme.instance.color.accentColorDark
// Theme.of(context).extension<StackColors>()!.accentColorDark
// ),
// ),
// child: Text(
// "fire test notification",
// style: STextStyles.button,
// style: STextStyles.button(context),
// ),
// onPressed: () async {
// NotificationApi.showNotification2(

View file

@ -7,7 +7,7 @@ import 'package:stackwallet/providers/global/debug_service_provider.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
class HiddenSettings extends StatelessWidget {
@ -18,12 +18,12 @@ class HiddenSettings extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: Container(),
title: Text(
"Not so secret anymore",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -63,9 +63,10 @@ class HiddenSettings extends StatelessWidget {
child: RoundedWhiteContainer(
child: Text(
"Delete notifications",
style: STextStyles.button.copyWith(
color: StackTheme
.instance.color.accentColorDark),
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
);
@ -91,8 +92,8 @@ class HiddenSettings extends StatelessWidget {
// child: RoundedWhiteContainer(
// child: Text(
// "Delete trade history",
// style: STextStyles.button.copyWith(
// color: StackTheme.instance.color.accentColorDark
// style: STextStyles.button(context).copyWith(
// color: Theme.of(context).extension<StackColors>()!.accentColorDark
// ),
// ),
// ),
@ -117,9 +118,10 @@ class HiddenSettings extends StatelessWidget {
child: RoundedWhiteContainer(
child: Text(
"Delete Debug Logs",
style: STextStyles.button.copyWith(
color: StackTheme
.instance.color.accentColorDark),
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
);
@ -146,8 +148,8 @@ class HiddenSettings extends StatelessWidget {
// child: RoundedWhiteContainer(
// child: Text(
// "Lottie test",
// style: STextStyles.button.copyWith(
// color: StackTheme.instance.color.accentColorDark
// style: STextStyles.button(context).copyWith(
// color: Theme.of(context).extension<StackColors>()!.accentColorDark
// ),
// ),
// ),

View file

@ -6,7 +6,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/languages_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
@ -99,7 +99,7 @@ class _LanguageViewState extends ConsumerState<LanguageSettingsView> {
}
listWithoutSelected = _filtered();
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -114,7 +114,7 @@ class _LanguageViewState extends ConsumerState<LanguageSettingsView> {
),
title: Text(
"Language",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -143,10 +143,11 @@ class _LanguageViewState extends ConsumerState<LanguageSettingsView> {
onChanged: (newString) {
setState(() => filter = newString);
},
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Search",
_searchFocusNode,
context,
).copyWith(
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(
@ -201,7 +202,9 @@ class _LanguageViewState extends ConsumerState<LanguageSettingsView> {
(context, index) {
return Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context)
.extension<StackColors>()!
.popupBG,
borderRadius: _borderRadius(index),
),
child: Padding(
@ -211,8 +214,12 @@ class _LanguageViewState extends ConsumerState<LanguageSettingsView> {
child: RoundedContainer(
padding: const EdgeInsets.all(0),
color: index == 0
? StackTheme.instance.color.currencyListItemBG
: StackTheme.instance.color.popupBG,
? Theme.of(context)
.extension<StackColors>()!
.currencyListItemBG
: Theme.of(context)
.extension<StackColors>()!
.popupBG,
child: RawMaterialButton(
onPressed: () async {
onTap(index);
@ -232,7 +239,8 @@ class _LanguageViewState extends ConsumerState<LanguageSettingsView> {
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme.instance.color
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: true,
groupValue: index == 0,
@ -254,7 +262,8 @@ class _LanguageViewState extends ConsumerState<LanguageSettingsView> {
? const Key(
"selectedLanguageSettingsLanguageText")
: null,
style: STextStyles.largeMedium14,
style: STextStyles.largeMedium14(
context),
),
const SizedBox(
height: 2,
@ -265,7 +274,8 @@ class _LanguageViewState extends ConsumerState<LanguageSettingsView> {
? const Key(
"selectedLanguageSettingsLanguageTextDescription")
: null,
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(
context),
),
],
),

View file

@ -19,7 +19,7 @@ import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/test_epic_box_connection.dart';
import 'package:stackwallet/utilities/test_monero_node_connection.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -192,7 +192,7 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
: null;
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -207,7 +207,7 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
),
title: Text(
viewType == AddEditNodeViewType.edit ? "Edit node" : "Add node",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
actions: [
if (viewType == AddEditNodeViewType.edit)
@ -223,10 +223,12 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
key: const Key("deleteNodeAppBarButtonKey"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
Assets.svg.trash,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 20,
height: 20,
),
@ -293,23 +295,30 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
await _testConnection();
}
: null,
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Test connection",
style: STextStyles.button.copyWith(
style: STextStyles.button(context).copyWith(
color: testConnectionEnabled
? StackTheme.instance.color.textDark
: StackTheme.instance.color.textWhite,
? Theme.of(context)
.extension<StackColors>()!
.textDark
: Theme.of(context)
.extension<StackColors>()!
.textWhite,
),
),
),
const SizedBox(height: 16),
TextButton(
style: saveEnabled
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
onPressed: saveEnabled
? () async {
@ -333,21 +342,25 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
},
child: Text(
"Cancel",
style: STextStyles.button.copyWith(
color: StackTheme.instance.color
.accentColorDark),
style: STextStyles.button(context)
.copyWith(
color: Theme.of(context)
.extension<
StackColors>()!
.accentColorDark),
),
),
rightButton: TextButton(
onPressed: () async {
Navigator.of(context).pop(true);
},
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(
context),
child: Text(
"Save",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
),
@ -440,7 +453,7 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
: null,
child: Text(
"Save",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],
@ -637,10 +650,11 @@ class _NodeFormState extends ConsumerState<NodeForm> {
enabled: enableField(_nameController),
controller: _nameController,
focusNode: _nameFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Node name",
_nameFocusNode,
context,
).copyWith(
suffixIcon: !widget.readOnly && _nameController.text.isNotEmpty
? Padding(
@ -683,12 +697,13 @@ class _NodeFormState extends ConsumerState<NodeForm> {
enabled: enableField(_hostController),
controller: _hostController,
focusNode: _hostFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
(widget.coin != Coin.monero && widget.coin != Coin.epicCash)
? "IP address"
: "Url",
_hostFocusNode,
context,
).copyWith(
suffixIcon:
!widget.readOnly && _hostController.text.isNotEmpty
@ -733,10 +748,11 @@ class _NodeFormState extends ConsumerState<NodeForm> {
focusNode: _portFocusNode,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
keyboardType: TextInputType.number,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Port",
_portFocusNode,
context,
).copyWith(
suffixIcon:
!widget.readOnly && _portController.text.isNotEmpty
@ -781,10 +797,11 @@ class _NodeFormState extends ConsumerState<NodeForm> {
enabled: enableField(_usernameController),
keyboardType: TextInputType.number,
focusNode: _usernameFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Login (optional)",
_usernameFocusNode,
context,
).copyWith(
suffixIcon:
!widget.readOnly && _usernameController.text.isNotEmpty
@ -827,10 +844,11 @@ class _NodeFormState extends ConsumerState<NodeForm> {
enabled: enableField(_passwordController),
keyboardType: TextInputType.number,
focusNode: _passwordFocusNode,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: standardInputDecoration(
"Password (optional)",
_passwordFocusNode,
context,
).copyWith(
suffixIcon:
!widget.readOnly && _passwordController.text.isNotEmpty
@ -883,8 +901,9 @@ class _NodeFormState extends ConsumerState<NodeForm> {
height: 20,
child: Checkbox(
fillColor: widget.readOnly
? MaterialStateProperty.all(
StackTheme.instance.color.checkboxBGDisabled)
? MaterialStateProperty.all(Theme.of(context)
.extension<StackColors>()!
.checkboxBGDisabled)
: null,
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
@ -904,7 +923,7 @@ class _NodeFormState extends ConsumerState<NodeForm> {
),
Text(
"Use SSL",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
)
],
),
@ -967,7 +986,7 @@ class _NodeFormState extends ConsumerState<NodeForm> {
),
Text(
"Use as failover",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
)
],
),

View file

@ -6,7 +6,7 @@ import 'package:stackwallet/pages/settings_views/sub_widgets/nodes_list.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:tuple/tuple.dart';
@ -38,7 +38,7 @@ class _CoinNodesViewState extends ConsumerState<CoinNodesView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -47,7 +47,7 @@ class _CoinNodesViewState extends ConsumerState<CoinNodesView> {
),
title: Text(
"${widget.coin.prettyName} nodes",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
actions: [
Padding(
@ -62,10 +62,12 @@ class _CoinNodesViewState extends ConsumerState<CoinNodesView> {
key: const Key("manageNodesAddNewNodeButtonKey"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
Assets.svg.plus,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 20,
height: 20,
),

View file

@ -7,7 +7,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -48,7 +48,7 @@ class _ManageNodesViewState extends ConsumerState<ManageNodesView> {
: _coins.sublist(0, _coins.length - kTestNetCoinCount);
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -57,7 +57,7 @@ class _ManageNodesViewState extends ConsumerState<ManageNodesView> {
),
title: Text(
"Manage nodes",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -82,7 +82,7 @@ class _ManageNodesViewState extends ConsumerState<ManageNodesView> {
child: RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
@ -112,11 +112,11 @@ class _ManageNodesViewState extends ConsumerState<ManageNodesView> {
children: [
Text(
"${coin.prettyName} nodes",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
Text(
count > 1 ? "$count nodes" : "Default",
style: STextStyles.label,
style: STextStyles.label(context),
),
],
)

View file

@ -16,7 +16,7 @@ import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/test_epic_box_connection.dart';
import 'package:stackwallet/utilities/test_monero_node_connection.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:tuple/tuple.dart';
@ -140,7 +140,7 @@ class _NodeDetailsViewState extends ConsumerState<NodeDetailsView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -155,7 +155,7 @@ class _NodeDetailsViewState extends ConsumerState<NodeDetailsView> {
),
title: Text(
"Node details",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
actions: [
if (!nodeId.startsWith("default"))
@ -171,10 +171,12 @@ class _NodeDetailsViewState extends ConsumerState<NodeDetailsView> {
key: const Key("nodeDetailsEditNodeAppBarButtonKey"),
size: 36,
shadows: const [],
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
icon: SvgPicture.asset(
Assets.svg.pencil,
color: StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
width: 20,
height: 20,
),
@ -223,16 +225,18 @@ class _NodeDetailsViewState extends ConsumerState<NodeDetailsView> {
),
const Spacer(),
TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
onPressed: () async {
await _testConnection(ref, context);
},
child: Text(
"Test connection",
style: STextStyles.button.copyWith(
color:
StackTheme.instance.color.accentColorDark),
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark),
),
),
const SizedBox(height: 16),

View file

@ -8,7 +8,7 @@ import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_pin_put/custom_pin_put.dart';
@ -31,9 +31,10 @@ class ChangePinView extends StatefulWidget {
class _ChangePinViewState extends State<ChangePinView> {
BoxDecoration get _pinPutDecoration {
return BoxDecoration(
color: StackTheme.instance.color.textSubtitle2,
border:
Border.all(width: 1, color: StackTheme.instance.color.textSubtitle2),
color: Theme.of(context).extension<StackColors>()!.textSubtitle2,
border: Border.all(
width: 1,
color: Theme.of(context).extension<StackColors>()!.textSubtitle2),
borderRadius: BorderRadius.circular(6),
);
}
@ -70,7 +71,7 @@ class _ChangePinViewState extends State<ChangePinView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -96,7 +97,7 @@ class _ChangePinViewState extends State<ChangePinView> {
Center(
child: Text(
"Create new PIN",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
),
const SizedBox(
@ -106,7 +107,7 @@ class _ChangePinViewState extends State<ChangePinView> {
fieldsCount: Constants.pinLength,
eachFieldHeight: 12,
eachFieldWidth: 12,
textStyle: STextStyles.label.copyWith(
textStyle: STextStyles.label(context).copyWith(
fontSize: 1,
),
focusNode: _pinPutFocusNode1,
@ -120,14 +121,19 @@ class _ChangePinViewState extends State<ChangePinView> {
disabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
fillColor: StackTheme.instance.color.background,
fillColor:
Theme.of(context).extension<StackColors>()!.background,
counterText: "",
),
submittedFieldDecoration: _pinPutDecoration.copyWith(
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
border: Border.all(
width: 1,
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
),
selectedFieldDecoration: _pinPutDecoration,
@ -152,7 +158,7 @@ class _ChangePinViewState extends State<ChangePinView> {
Center(
child: Text(
"Confirm new PIN",
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
),
const SizedBox(
@ -176,14 +182,19 @@ class _ChangePinViewState extends State<ChangePinView> {
disabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
fillColor: StackTheme.instance.color.background,
fillColor:
Theme.of(context).extension<StackColors>()!.background,
counterText: "",
),
submittedFieldDecoration: _pinPutDecoration.copyWith(
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
border: Border.all(
width: 1,
color: StackTheme.instance.color.infoItemIcons,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
),
selectedFieldDecoration: _pinPutDecoration,

View file

@ -6,7 +6,7 @@ import 'package:stackwallet/providers/global/prefs_provider.dart';
import 'package:stackwallet/route_generator.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -23,7 +23,7 @@ class SecurityView extends StatelessWidget {
debugPrint("BUILD: $runtimeType");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -32,7 +32,7 @@ class SecurityView extends StatelessWidget {
),
title: Text(
"Security",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -43,7 +43,7 @@ class SecurityView extends StatelessWidget {
RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
@ -77,7 +77,7 @@ class SecurityView extends StatelessWidget {
children: [
Text(
"Change PIN",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
],
@ -92,7 +92,7 @@ class SecurityView extends StatelessWidget {
child: Consumer(
builder: (_, ref, __) {
return RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
@ -118,7 +118,7 @@ class SecurityView extends StatelessWidget {
children: [
Text(
"Enable biometric authentication",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
SizedBox(

View file

@ -10,7 +10,7 @@ import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart';
@ -81,11 +81,14 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
title: "Enable Auto Backup",
message: "To enable Auto Backup, you need to create a backup file.",
leftButton: TextButton(
style: StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Back",
style: STextStyles.button.copyWith(
color: StackTheme.instance.color.accentColorDark,
style: STextStyles.button(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.accentColorDark,
),
),
onPressed: () {
@ -93,10 +96,12 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
},
),
rightButton: TextButton(
style: StackTheme.instance.getPrimaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Continue",
style: STextStyles.button,
style: STextStyles.button(context),
),
onPressed: () {
Navigator.of(context).pop(true);
@ -133,11 +138,14 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
message:
"You are turning off Auto Backup. You can turn it back on at any time. Your previous Auto Backup file will not be deleted. Remember to backup your wallets manually so you don't lose important information.",
leftButton: TextButton(
style: StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Back",
style: STextStyles.button.copyWith(
color: StackTheme.instance.color.accentColorDark,
style: STextStyles.button(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.accentColorDark,
),
),
onPressed: () {
@ -145,10 +153,12 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
},
),
rightButton: TextButton(
style: StackTheme.instance.getPrimaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Disable",
style: STextStyles.button,
style: STextStyles.button(context),
),
onPressed: () {
Navigator.of(context).pop(true);
@ -214,7 +224,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
});
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -223,7 +233,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
),
title: Text(
"Auto Backup",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -234,7 +244,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
@ -252,7 +262,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
children: [
Text(
"Auto Backup",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
SizedBox(
@ -286,14 +296,14 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
child: RichText(
textAlign: TextAlign.left,
text: TextSpan(
style: STextStyles.label,
style: STextStyles.label(context),
children: [
const TextSpan(
text:
"Auto Backup is a custom Stack Wallet feature that offers a convenient backup of your data.\n\nTo ensure maximum security, we recommend using a unique password that you haven't used anywhere else on the internet before. Your password is not stored.\n\nFor more information, please see our website "),
TextSpan(
text: "stackwallet.com.",
style: STextStyles.richLink,
style: STextStyles.richLink(context),
recognizer: TapGestureRecognizer()
..onTap = () {
launchUrl(
@ -322,7 +332,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
),
Text(
"Backed up ${prettySinceLastBackupString(ref.watch(prefsChangeNotifierProvider.select((value) => value.lastAutoBackup)))}",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
)
],
),
@ -332,7 +342,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
),
Text(
"Auto Backup file",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 10,
@ -346,9 +356,11 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
focusNode: fileLocationFocusNode,
controller: fileLocationController,
enabled: false,
style: STextStyles.field.copyWith(
color:
StackTheme.instance.color.textDark.withOpacity(0.5),
style: STextStyles.field(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark
.withOpacity(0.5),
),
readOnly: true,
enableSuggestions: false,
@ -362,6 +374,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
decoration: standardInputDecoration(
"Saved to",
fileLocationFocusNode,
context,
),
),
),
@ -377,9 +390,11 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
focusNode: passwordFocusNode,
controller: passwordController,
enabled: false,
style: STextStyles.field.copyWith(
color:
StackTheme.instance.color.textDark.withOpacity(0.5),
style: STextStyles.field(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark
.withOpacity(0.5),
),
obscureText: true,
enableSuggestions: false,
@ -393,6 +408,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
decoration: standardInputDecoration(
"Passphrase",
passwordFocusNode,
context,
),
),
),
@ -401,7 +417,7 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
),
Text(
"Auto Backup frequency",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 10,
@ -410,9 +426,11 @@ class _AutoBackupViewState extends ConsumerState<AutoBackupView> {
key: const Key("backupFrequencyFieldKey"),
controller: frequencyController,
enabled: false,
style: STextStyles.field.copyWith(
color:
StackTheme.instance.color.textDark.withOpacity(0.5),
style: STextStyles.field(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark
.withOpacity(0.5),
),
toolbarOptions: const ToolbarOptions(
copy: true,

View file

@ -20,7 +20,7 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/progress_bar.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -102,7 +102,7 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
debugPrint("BUILD: $runtimeType");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -111,7 +111,7 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
),
title: Text(
"Create Auto Backup",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -128,7 +128,7 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
children: [
Text(
"Create your backup file",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 10,
@ -153,7 +153,7 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
}
},
controller: fileLocationController,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: InputDecoration(
hintText: "Save to...",
suffixIcon: UnconstrainedBox(
@ -164,7 +164,9 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
),
SvgPicture.asset(
Assets.svg.folder,
color: StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -197,13 +199,14 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
key: const Key("createBackupPasswordFieldKey1"),
focusNode: passwordFocusNode,
controller: passwordController,
style: STextStyles.field,
style: STextStyles.field(context),
obscureText: hidePassword,
enableSuggestions: false,
autocorrect: false,
decoration: standardInputDecoration(
"Create passphrase",
passwordFocusNode,
context,
).copyWith(
suffixIcon: UnconstrainedBox(
child: Row(
@ -223,7 +226,9 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
hidePassword
? Assets.svg.eye
: Assets.svg.eyeSlash,
color: StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -284,7 +289,7 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
child: passwordFeedback.isNotEmpty
? Text(
passwordFeedback,
style: STextStyles.infoSmall,
style: STextStyles.infoSmall(context),
)
: null,
),
@ -302,12 +307,19 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
width: MediaQuery.of(context).size.width - 32 - 24,
height: 5,
fillColor: passwordStrength < 0.51
? StackTheme.instance.color.accentColorRed
? Theme.of(context)
.extension<StackColors>()!
.accentColorRed
: passwordStrength < 1
? StackTheme.instance.color.accentColorYellow
: StackTheme.instance.color.accentColorGreen,
backgroundColor:
StackTheme.instance.color.buttonBackSecondary,
? Theme.of(context)
.extension<StackColors>()!
.accentColorYellow
: Theme.of(context)
.extension<StackColors>()!
.accentColorGreen,
backgroundColor: Theme.of(context)
.extension<StackColors>()!
.buttonBackSecondary,
percent:
passwordStrength < 0.25 ? 0.03 : passwordStrength,
),
@ -323,13 +335,14 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
key: const Key("createBackupPasswordFieldKey2"),
focusNode: passwordRepeatFocusNode,
controller: passwordRepeatController,
style: STextStyles.field,
style: STextStyles.field(context),
obscureText: hidePassword,
enableSuggestions: false,
autocorrect: false,
decoration: standardInputDecoration(
"Confirm passphrase",
passwordRepeatFocusNode,
context,
).copyWith(
suffixIcon: UnconstrainedBox(
child: Row(
@ -349,7 +362,9 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
hidePassword
? Assets.svg.eye
: Assets.svg.eyeSlash,
color: StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -372,7 +387,7 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
),
Text(
"Auto Backup frequency",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 10,
@ -385,7 +400,9 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
),
Positioned.fill(
child: RawMaterialButton(
splashColor: StackTheme.instance.color.highlight,
splashColor: Theme.of(context)
.extension<StackColors>()!
.highlight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
@ -416,14 +433,15 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
prefsChangeNotifierProvider.select(
(value) =>
value.backupFrequencyType))),
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
Padding(
padding: const EdgeInsets.only(right: 4.0),
child: SvgPicture.asset(
Assets.svg.chevronDown,
color: StackTheme
.instance.color.textSubtitle2,
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle2,
width: 12,
height: 6,
),
@ -441,9 +459,11 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
),
TextButton(
style: shouldEnableCreate
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
onPressed: !shouldEnableCreate
? null
@ -596,7 +616,7 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
},
child: Text(
"Enable Auto Backup",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],

View file

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -13,7 +13,7 @@ class CreateBackupInfoView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -26,7 +26,7 @@ class CreateBackupInfoView extends StatelessWidget {
),
title: Text(
"Create backup",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -45,7 +45,7 @@ class CreateBackupInfoView extends StatelessWidget {
Center(
child: Text(
"Info",
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
),
),
const SizedBox(
@ -55,7 +55,7 @@ class CreateBackupInfoView extends StatelessWidget {
child: Text(
// TODO: need info
"{lorem ipsum}",
style: STextStyles.baseXS,
style: STextStyles.baseXS(context),
),
),
const SizedBox(
@ -63,7 +63,8 @@ class CreateBackupInfoView extends StatelessWidget {
),
const Spacer(),
TextButton(
style: StackTheme.instance
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: () {
Navigator.of(context)
@ -71,7 +72,7 @@ class CreateBackupInfoView extends StatelessWidget {
},
child: Text(
"Next",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],

View file

@ -13,7 +13,7 @@ import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/progress_bar.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -82,7 +82,7 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -97,7 +97,7 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
),
title: Text(
"Create backup",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -153,7 +153,7 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
}
},
controller: fileLocationController,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: InputDecoration(
hintText: "Save to...",
suffixIcon: UnconstrainedBox(
@ -164,8 +164,9 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
),
SvgPicture.asset(
Assets.svg.folder,
color:
StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -202,13 +203,14 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
key: const Key("createBackupPasswordFieldKey1"),
focusNode: passwordFocusNode,
controller: passwordController,
style: STextStyles.field,
style: STextStyles.field(context),
obscureText: hidePassword,
enableSuggestions: false,
autocorrect: false,
decoration: standardInputDecoration(
"Create passphrase",
passwordFocusNode,
context,
).copyWith(
suffixIcon: UnconstrainedBox(
child: Row(
@ -228,8 +230,9 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
hidePassword
? Assets.svg.eye
: Assets.svg.eyeSlash,
color:
StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -290,7 +293,7 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
child: passwordFeedback.isNotEmpty
? Text(
passwordFeedback,
style: STextStyles.infoSmall,
style: STextStyles.infoSmall(context),
)
: null,
),
@ -308,14 +311,15 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
width: MediaQuery.of(context).size.width - 32 - 24,
height: 5,
fillColor: passwordStrength < 0.51
? StackTheme.instance.color.accentColorRed
? Theme.of(context)
.extension<StackColors>()!
.accentColorRed
: passwordStrength < 1
? StackTheme
.instance.color.accentColorYellow
: StackTheme
.instance.color.accentColorGreen,
backgroundColor:
StackTheme.instance.color.buttonBackSecondary,
? Theme.of(context).extension<StackColors>()!.accentColorYellow
: Theme.of(context).extension<StackColors>()!.accentColorGreen,
backgroundColor: Theme.of(context)
.extension<StackColors>()!
.buttonBackSecondary,
percent: passwordStrength < 0.25
? 0.03
: passwordStrength,
@ -332,13 +336,14 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
key: const Key("createBackupPasswordFieldKey2"),
focusNode: passwordRepeatFocusNode,
controller: passwordRepeatController,
style: STextStyles.field,
style: STextStyles.field(context),
obscureText: hidePassword,
enableSuggestions: false,
autocorrect: false,
decoration: standardInputDecoration(
"Confirm passphrase",
passwordRepeatFocusNode,
context,
).copyWith(
suffixIcon: UnconstrainedBox(
child: Row(
@ -358,8 +363,9 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
hidePassword
? Assets.svg.eye
: Assets.svg.eyeSlash,
color:
StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -383,10 +389,8 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
const Spacer(),
TextButton(
style: shouldEnableCreate
? StackTheme.instance
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
.getPrimaryDisabledButtonColor(context),
? Theme.of(context) .extension<StackColors>()!.getPrimaryEnabledButtonColor(context)
: Theme.of(context) .extension<StackColors>()!.getPrimaryDisabledButtonColor(context),
onPressed: !shouldEnableCreate
? null
: () async {
@ -482,7 +486,7 @@ class _RestoreFromFileViewState extends State<CreateBackupView> {
},
child: Text(
"Create backup",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class CancelStackRestoreDialog extends StatelessWidget {
@ -19,21 +19,26 @@ class CancelStackRestoreDialog extends StatelessWidget {
message:
"Cancelling will revert any changes that may have been applied",
leftButton: TextButton(
style: StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
"Back",
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
onPressed: () {
Navigator.of(context).pop(false);
},
),
rightButton: TextButton(
style: StackTheme.instance.getPrimaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
child: Text(
"Yes, cancel",
style: STextStyles.itemSubtitle12.copyWith(
color: StackTheme.instance.color.buttonTextPrimary,
style: STextStyles.itemSubtitle12(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.buttonTextPrimary,
),
),
onPressed: () {

View file

@ -20,7 +20,7 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/progress_bar.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
@ -104,7 +104,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
debugPrint("BUILD: $runtimeType");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -113,7 +113,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
),
title: Text(
"Edit Auto Backup",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -130,7 +130,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
children: [
Text(
"Create your backup",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 10,
@ -155,7 +155,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
}
},
controller: fileLocationController,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: InputDecoration(
hintText: "Save to...",
suffixIcon: UnconstrainedBox(
@ -166,7 +166,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
),
SvgPicture.asset(
Assets.svg.folder,
color: StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -199,13 +201,14 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
key: const Key("createBackupPasswordFieldKey1"),
focusNode: passwordFocusNode,
controller: passwordController,
style: STextStyles.field,
style: STextStyles.field(context),
obscureText: hidePassword,
enableSuggestions: false,
autocorrect: false,
decoration: standardInputDecoration(
"Create passphrase",
passwordFocusNode,
context,
).copyWith(
suffixIcon: UnconstrainedBox(
child: Row(
@ -225,7 +228,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
hidePassword
? Assets.svg.eye
: Assets.svg.eyeSlash,
color: StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -286,7 +291,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
child: passwordFeedback.isNotEmpty
? Text(
passwordFeedback,
style: STextStyles.infoSmall,
style: STextStyles.infoSmall(context),
)
: null,
),
@ -304,12 +309,19 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
width: MediaQuery.of(context).size.width - 32 - 24,
height: 5,
fillColor: passwordStrength < 0.51
? StackTheme.instance.color.accentColorRed
? Theme.of(context)
.extension<StackColors>()!
.accentColorRed
: passwordStrength < 1
? StackTheme.instance.color.accentColorYellow
: StackTheme.instance.color.accentColorGreen,
backgroundColor:
StackTheme.instance.color.buttonBackSecondary,
? Theme.of(context)
.extension<StackColors>()!
.accentColorYellow
: Theme.of(context)
.extension<StackColors>()!
.accentColorGreen,
backgroundColor: Theme.of(context)
.extension<StackColors>()!
.buttonBackSecondary,
percent:
passwordStrength < 0.25 ? 0.03 : passwordStrength,
),
@ -325,13 +337,14 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
key: const Key("createBackupPasswordFieldKey2"),
focusNode: passwordRepeatFocusNode,
controller: passwordRepeatController,
style: STextStyles.field,
style: STextStyles.field(context),
obscureText: hidePassword,
enableSuggestions: false,
autocorrect: false,
decoration: standardInputDecoration(
"Confirm passphrase",
passwordRepeatFocusNode,
context,
).copyWith(
suffixIcon: UnconstrainedBox(
child: Row(
@ -351,7 +364,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
hidePassword
? Assets.svg.eye
: Assets.svg.eyeSlash,
color: StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -374,7 +389,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
),
Text(
"Auto Backup frequency",
style: STextStyles.smallMed12,
style: STextStyles.smallMed12(context),
),
const SizedBox(
height: 10,
@ -387,7 +402,9 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
),
Positioned.fill(
child: RawMaterialButton(
splashColor: StackTheme.instance.color.highlight,
splashColor: Theme.of(context)
.extension<StackColors>()!
.highlight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
@ -418,14 +435,15 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
prefsChangeNotifierProvider.select(
(value) =>
value.backupFrequencyType))),
style: STextStyles.itemSubtitle12,
style: STextStyles.itemSubtitle12(context),
),
Padding(
padding: const EdgeInsets.only(right: 4.0),
child: SvgPicture.asset(
Assets.svg.chevronDown,
color: StackTheme
.instance.color.textSubtitle2,
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle2,
width: 12,
height: 6,
),
@ -443,9 +461,11 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
),
TextButton(
style: shouldEnableCreate
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
onPressed: !shouldEnableCreate
? null
@ -597,7 +617,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
},
child: Text(
"Save",
style: STextStyles.button,
style: STextStyles.button(context),
),
)
],

View file

@ -11,7 +11,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
import 'package:stackwallet/widgets/stack_text_field.dart';
@ -63,7 +63,7 @@ class _RestoreFromEncryptedStringViewState
return WillPopScope(
onWillPop: _onWillPop,
child: Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -78,7 +78,7 @@ class _RestoreFromEncryptedStringViewState
),
title: Text(
"Restore from file",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -102,13 +102,14 @@ class _RestoreFromEncryptedStringViewState
key: const Key("restoreFromFilePasswordFieldKey"),
focusNode: passwordFocusNode,
controller: passwordController,
style: STextStyles.field,
style: STextStyles.field(context),
obscureText: hidePassword,
enableSuggestions: false,
autocorrect: false,
decoration: standardInputDecoration(
"Enter password",
passwordFocusNode,
context,
).copyWith(
suffixIcon: UnconstrainedBox(
child: Row(
@ -128,8 +129,9 @@ class _RestoreFromEncryptedStringViewState
hidePassword
? Assets.svg.eye
: Assets.svg.eyeSlash,
color:
StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -152,9 +154,11 @@ class _RestoreFromEncryptedStringViewState
const Spacer(),
TextButton(
style: passwordController.text.isEmpty
? StackTheme.instance
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context),
onPressed: passwordController.text.isEmpty
? null
@ -187,10 +191,12 @@ class _RestoreFromEncryptedStringViewState
child: Center(
child: Text(
"Decrypting Stack backup file",
style: STextStyles.pageTitleH2
style: STextStyles.pageTitleH2(
context)
.copyWith(
color: StackTheme
.instance.color.textWhite,
color: Theme.of(context)
.extension<StackColors>()!
.textWhite,
),
),
),
@ -245,7 +251,7 @@ class _RestoreFromEncryptedStringViewState
},
child: Text(
"Restore",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],

View file

@ -14,7 +14,7 @@ import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
import 'package:stackwallet/widgets/stack_text_field.dart';
@ -64,7 +64,7 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -79,7 +79,7 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
),
title: Text(
"Restore from file",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -127,7 +127,7 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
}
},
controller: fileLocationController,
style: STextStyles.field,
style: STextStyles.field(context),
decoration: InputDecoration(
hintText: "Choose file...",
suffixIcon: UnconstrainedBox(
@ -138,7 +138,9 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
),
SvgPicture.asset(
Assets.svg.folder,
color: StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -170,13 +172,14 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
key: const Key("restoreFromFilePasswordFieldKey"),
focusNode: passwordFocusNode,
controller: passwordController,
style: STextStyles.field,
style: STextStyles.field(context),
obscureText: hidePassword,
enableSuggestions: false,
autocorrect: false,
decoration: standardInputDecoration(
"Enter password",
passwordFocusNode,
context,
).copyWith(
suffixIcon: UnconstrainedBox(
child: Row(
@ -196,8 +199,9 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
hidePassword
? Assets.svg.eye
: Assets.svg.eyeSlash,
color:
StackTheme.instance.color.textDark3,
color: Theme.of(context)
.extension<StackColors>()!
.textDark3,
width: 16,
height: 16,
),
@ -221,10 +225,12 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
TextButton(
style: passwordController.text.isEmpty ||
fileLocationController.text.isEmpty
? StackTheme.instance
.getPrimaryEnabledButtonColor(context)
: StackTheme.instance
.getPrimaryDisabledButtonColor(context),
? Theme.of(context)
.extension<StackColors>()!
.getPrimaryDisabledButtonColor(context)
: Theme.of(context)
.extension<StackColors>()!
.getPrimaryEnabledButtonColor(context),
onPressed: passwordController.text.isEmpty ||
fileLocationController.text.isEmpty
? null
@ -268,10 +274,12 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
child: Center(
child: Text(
"Decrypting Stack backup file",
style: STextStyles.pageTitleH2
style: STextStyles.pageTitleH2(
context)
.copyWith(
color: StackTheme
.instance.color.textWhite,
color: Theme.of(context)
.extension<StackColors>()!
.textWhite,
),
),
),
@ -322,7 +330,7 @@ class _RestoreFromFileViewState extends ConsumerState<RestoreFromFileView> {
},
child: Text(
"Restore",
style: STextStyles.button,
style: STextStyles.button(context),
),
),
],

View file

@ -6,7 +6,7 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -22,7 +22,7 @@ class StackBackupView extends StatelessWidget {
debugPrint("BUILD: $runtimeType");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -31,7 +31,7 @@ class StackBackupView extends StatelessWidget {
),
title: Text(
"Stack backup",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -42,7 +42,7 @@ class StackBackupView extends StatelessWidget {
RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
@ -69,7 +69,7 @@ class StackBackupView extends StatelessWidget {
),
Text(
"Auto Backup",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
],
@ -83,7 +83,7 @@ class StackBackupView extends StatelessWidget {
RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
@ -111,7 +111,7 @@ class StackBackupView extends StatelessWidget {
),
Text(
"Create manual backup",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
],
@ -125,7 +125,7 @@ class StackBackupView extends StatelessWidget {
RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
@ -153,7 +153,7 @@ class StackBackupView extends StatelessWidget {
),
Text(
"Restore backup",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
],

View file

@ -4,7 +4,7 @@ import 'package:stackwallet/providers/global/prefs_provider.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
const BackupFrequencyTypeSelectSheet({
@ -32,7 +32,7 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
},
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.popupBG,
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(20),
),
@ -51,7 +51,9 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
Center(
child: Container(
decoration: BoxDecoration(
color: StackTheme.instance.color.textFieldDefaultBG,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
@ -68,7 +70,7 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
children: [
Text(
"Auto Backup frequency",
style: STextStyles.pageTitleH2,
style: STextStyles.pageTitleH2(context),
textAlign: TextAlign.left,
),
const SizedBox(
@ -100,8 +102,9 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme
.instance.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: BackupFrequencyType.values[i],
groupValue: ref.watch(
prefsChangeNotifierProvider.select(
@ -125,7 +128,7 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
Text(
prettyFrequencyType(
BackupFrequencyType.values[i]),
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
textAlign: TextAlign.left,
),
],

View file

@ -7,7 +7,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
class RecoverPhraseView extends StatelessWidget {
@ -28,7 +28,7 @@ class RecoverPhraseView extends StatelessWidget {
Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType");
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
@ -41,7 +41,7 @@ class RecoverPhraseView extends StatelessWidget {
child: AspectRatio(
aspectRatio: 1,
child: AppBarIconButton(
color: StackTheme.instance.color.background,
color: Theme.of(context).extension<StackColors>()!.background,
shadows: const [],
icon: SvgPicture.asset(
Assets.svg.copy,
@ -74,7 +74,7 @@ class RecoverPhraseView extends StatelessWidget {
Text(
walletName,
textAlign: TextAlign.center,
style: STextStyles.label.copyWith(
style: STextStyles.label(context).copyWith(
fontSize: 12,
),
),
@ -84,7 +84,7 @@ class RecoverPhraseView extends StatelessWidget {
Text(
"Recovery Phrase",
textAlign: TextAlign.center,
style: STextStyles.pageTitleH1,
style: STextStyles.pageTitleH1(context),
),
const SizedBox(
height: 12,

View file

@ -16,7 +16,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/stack_restoring_status.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/icon_widgets/addressbook_icon.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
@ -57,8 +57,9 @@ class _StackRestoreProgressViewState
child: Center(
child: Text(
"Cancelling restore. Please wait.",
style: STextStyles.pageTitleH2.copyWith(
color: StackTheme.instance.color.textWhite,
style: STextStyles.pageTitleH2(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.textWhite,
),
),
),
@ -140,22 +141,23 @@ class _StackRestoreProgressViewState
case StackRestoringStatus.waiting:
return SvgPicture.asset(
Assets.svg.loader,
color: StackTheme.instance.color.buttonBackSecondary,
color:
Theme.of(context).extension<StackColors>()!.buttonBackSecondary,
);
case StackRestoringStatus.restoring:
return SvgPicture.asset(
Assets.svg.loader,
color: StackTheme.instance.color.accentColorGreen,
color: Theme.of(context).extension<StackColors>()!.accentColorGreen,
);
case StackRestoringStatus.success:
return SvgPicture.asset(
Assets.svg.checkCircle,
color: StackTheme.instance.color.accentColorGreen,
color: Theme.of(context).extension<StackColors>()!.accentColorGreen,
);
case StackRestoringStatus.failed:
return SvgPicture.asset(
Assets.svg.circleAlert,
color: StackTheme.instance.color.textError,
color: Theme.of(context).extension<StackColors>()!.textError,
);
}
}
@ -180,7 +182,7 @@ class _StackRestoreProgressViewState
return WillPopScope(
onWillPop: _onWillPop,
child: Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -202,7 +204,7 @@ class _StackRestoreProgressViewState
),
title: Text(
"Restoring Stack wallet",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -224,7 +226,7 @@ class _StackRestoreProgressViewState
children: [
Text(
"Settings",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 12,
@ -239,15 +241,17 @@ class _StackRestoreProgressViewState
height: 32,
child: RoundedContainer(
padding: const EdgeInsets.all(0),
color:
StackTheme.instance.color.buttonBackSecondary,
color: Theme.of(context)
.extension<StackColors>()!
.buttonBackSecondary,
child: Center(
child: SvgPicture.asset(
Assets.svg.gear,
width: 16,
height: 16,
color:
StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
),
),
@ -261,7 +265,7 @@ class _StackRestoreProgressViewState
subTitle: state == StackRestoringStatus.failed
? Text(
"Something went wrong",
style: STextStyles.errorSmall,
style: STextStyles.errorSmall(context),
)
: null,
);
@ -280,14 +284,16 @@ class _StackRestoreProgressViewState
height: 32,
child: RoundedContainer(
padding: const EdgeInsets.all(0),
color:
StackTheme.instance.color.buttonBackSecondary,
color: Theme.of(context)
.extension<StackColors>()!
.buttonBackSecondary,
child: Center(
child: AddressBookIcon(
width: 16,
height: 16,
color:
StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
),
),
@ -301,7 +307,7 @@ class _StackRestoreProgressViewState
subTitle: state == StackRestoringStatus.failed
? Text(
"Something went wrong",
style: STextStyles.errorSmall,
style: STextStyles.errorSmall(context),
)
: null,
);
@ -320,15 +326,17 @@ class _StackRestoreProgressViewState
height: 32,
child: RoundedContainer(
padding: const EdgeInsets.all(0),
color:
StackTheme.instance.color.buttonBackSecondary,
color: Theme.of(context)
.extension<StackColors>()!
.buttonBackSecondary,
child: Center(
child: SvgPicture.asset(
Assets.svg.node,
width: 16,
height: 16,
color:
StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
),
),
@ -342,7 +350,7 @@ class _StackRestoreProgressViewState
subTitle: state == StackRestoringStatus.failed
? Text(
"Something went wrong",
style: STextStyles.errorSmall,
style: STextStyles.errorSmall(context),
)
: null,
);
@ -361,15 +369,17 @@ class _StackRestoreProgressViewState
height: 32,
child: RoundedContainer(
padding: const EdgeInsets.all(0),
color:
StackTheme.instance.color.buttonBackSecondary,
color: Theme.of(context)
.extension<StackColors>()!
.buttonBackSecondary,
child: Center(
child: SvgPicture.asset(
Assets.svg.arrowRotate2,
width: 16,
height: 16,
color:
StackTheme.instance.color.accentColorDark,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorDark,
),
),
),
@ -383,7 +393,7 @@ class _StackRestoreProgressViewState
subTitle: state == StackRestoringStatus.failed
? Text(
"Something went wrong",
style: STextStyles.errorSmall,
style: STextStyles.errorSmall(context),
)
: null,
);
@ -394,7 +404,7 @@ class _StackRestoreProgressViewState
),
Text(
"Wallets",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
height: 8,
@ -433,11 +443,15 @@ class _StackRestoreProgressViewState
}
}
},
style: StackTheme.instance.getSecondaryEnabledButtonColor(context),
style: Theme.of(context)
.extension<StackColors>()!
.getSecondaryEnabledButtonColor(context),
child: Text(
_success ? "OK" : "Cancel restore process",
style: STextStyles.button.copyWith(
color: StackTheme.instance.color.buttonTextPrimary,
style: STextStyles.button(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextPrimary,
),
),
),

View file

@ -48,7 +48,7 @@ class RestoringItemCard extends StatelessWidget {
children: [
Text(
title,
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(context),
),
if (subTitle != null)
const SizedBox(

View file

@ -10,7 +10,7 @@ import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/stack_restoring_status.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
import 'package:stackwallet/widgets/rounded_container.dart';
@ -35,23 +35,23 @@ class _RestoringWalletCardState extends ConsumerState<RestoringWalletCard> {
case StackRestoringStatus.waiting:
return SvgPicture.asset(
Assets.svg.loader,
color: StackTheme.instance.color.buttonBackSecondary,
color: Theme.of(context).extension<StackColors>()!.buttonBackSecondary,
);
case StackRestoringStatus.restoring:
return const LoadingIndicator();
// return SvgPicture.asset(
// Assets.svg.loader,
// color: StackTheme.instance.color.accentColorGreen,
// color: Theme.of(context).extension<StackColors>()!.accentColorGreen,
// );
case StackRestoringStatus.success:
return SvgPicture.asset(
Assets.svg.checkCircle,
color: StackTheme.instance.color.accentColorGreen,
color: Theme.of(context).extension<StackColors>()!.accentColorGreen,
);
case StackRestoringStatus.failed:
return SvgPicture.asset(
Assets.svg.circleAlert,
color: StackTheme.instance.color.textError,
color: Theme.of(context).extension<StackColors>()!.textError,
);
}
}
@ -73,7 +73,7 @@ class _RestoringWalletCardState extends ConsumerState<RestoringWalletCard> {
height: 32,
child: RoundedContainer(
padding: const EdgeInsets.all(0),
color: StackTheme.instance.colorForCoin(coin),
color: Theme.of(context).extension<StackColors>()!.colorForCoin(coin),
child: Center(
child: SvgPicture.asset(
Assets.svg.iconFor(
@ -143,26 +143,26 @@ class _RestoringWalletCardState extends ConsumerState<RestoringWalletCard> {
subTitle: restoringStatus == StackRestoringStatus.failed
? Text(
"Unable to restore. Tap icon to retry.",
style: STextStyles.errorSmall,
style: STextStyles.errorSmall(context),
)
: ref.watch(provider.select((value) => value.address)) != null
? Text(
ref.watch(provider.select((value) => value.address))!,
style: STextStyles.infoSmall,
style: STextStyles.infoSmall(context),
)
: null,
button: restoringStatus == StackRestoringStatus.failed
? Container(
height: 20,
decoration: BoxDecoration(
color: StackTheme.instance.color.buttonBackSecondary,
color: Theme.of(context).extension<StackColors>()!.buttonBackSecondary,
borderRadius: BorderRadius.circular(
1000,
),
),
child: RawMaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
splashColor: StackTheme.instance.color.highlight,
splashColor: Theme.of(context).extension<StackColors>()!.highlight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
1000,
@ -186,8 +186,8 @@ class _RestoringWalletCardState extends ConsumerState<RestoringWalletCard> {
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text(
"Show recovery phrase",
style: STextStyles.infoSmall.copyWith(
color: StackTheme.instance.color.accentColorDark),
style: STextStyles.infoSmall(context).copyWith(
color: Theme.of(context).extension<StackColors>()!.accentColorDark),
),
),
),

View file

@ -4,7 +4,7 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/startup_pr
import 'package:stackwallet/providers/global/prefs_provider.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_theme.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
@ -23,7 +23,7 @@ class _StartupPreferencesViewState
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: StackTheme.instance.color.background,
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () async {
@ -32,7 +32,7 @@ class _StartupPreferencesViewState
),
title: Text(
"Startup preferences",
style: STextStyles.navBarTitle,
style: STextStyles.navBarTitle(context),
),
),
body: Padding(
@ -56,7 +56,7 @@ class _StartupPreferencesViewState
Padding(
padding: const EdgeInsets.all(4.0),
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
@ -81,8 +81,9 @@ class _StartupPreferencesViewState
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme.instance
.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: false,
groupValue: ref.watch(
prefsChangeNotifierProvider
@ -109,12 +110,14 @@ class _StartupPreferencesViewState
children: [
Text(
"Home screen",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(
context),
textAlign: TextAlign.left,
),
Text(
"Stack Wallet home screen",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(
context),
textAlign: TextAlign.left,
),
],
@ -129,7 +132,7 @@ class _StartupPreferencesViewState
Padding(
padding: const EdgeInsets.all(4),
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
@ -154,8 +157,9 @@ class _StartupPreferencesViewState
width: 20,
height: 20,
child: Radio(
activeColor: StackTheme.instance
.color.radioButtonIconEnabled,
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: true,
groupValue: ref.watch(
prefsChangeNotifierProvider
@ -182,12 +186,14 @@ class _StartupPreferencesViewState
children: [
Text(
"Specific wallet",
style: STextStyles.titleBold12,
style: STextStyles.titleBold12(
context),
textAlign: TextAlign.left,
),
Text(
"Select a specific wallet to load into on startup",
style: STextStyles.itemSubtitle,
style: STextStyles.itemSubtitle(
context),
textAlign: TextAlign.left,
),
],
@ -224,7 +230,7 @@ class _StartupPreferencesViewState
),
Flexible(
child: RawMaterialButton(
// splashColor: StackTheme.instance.color.highlight,
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
@ -244,7 +250,8 @@ class _StartupPreferencesViewState
children: [
Text(
"Select wallet...",
style: STextStyles.link2,
style:
STextStyles.link2(context),
textAlign: TextAlign.left,
),
],

Some files were not shown because too many files have changed in this diff Show more