From b016c21140a9dd37ae8575e80a0956984365f63c Mon Sep 17 00:00:00 2001 From: sneurlax Date: Mon, 13 May 2024 14:44:19 -0500 Subject: [PATCH] whiteLabel.dart -> app_config.dart related rafactorings --- lib/main.dart | 6 +++--- lib/pages/address_book_views/address_book_view.dart | 4 ++-- .../exchange_view/exchange_step_views/step_4_view.dart | 4 ++-- lib/pages/home_view/home_view.dart | 4 ++-- lib/pages/intro_view.dart | 6 +++--- .../stack_backup_views/restore_from_file_view.dart | 4 ++-- .../sub_views/stack_restore_progress_view.dart | 4 ++-- .../settings_views/global_settings_view/support_view.dart | 4 ++-- .../address_book_view/desktop_address_book.dart | 4 ++-- .../desktop_exchange/exchange_steps/step_scaffold.dart | 4 ++-- lib/pages_desktop_specific/desktop_menu.dart | 6 +++--- .../my_stack_view/exit_to_my_stack_button.dart | 4 ++-- lib/pages_desktop_specific/my_stack_view/my_stack_view.dart | 4 ++-- lib/pages_desktop_specific/password/desktop_login_view.dart | 4 ++-- .../password/forgotten_passphrase_restore_from_swb.dart | 4 ++-- .../settings/settings_menu/desktop_about_view.dart | 4 ++-- lib/utilities/featured_paynyms.dart | 4 ++-- lib/{whiteLabel.dart => white_label.dart} | 2 +- 18 files changed, 38 insertions(+), 38 deletions(-) rename lib/{whiteLabel.dart => white_label.dart} (86%) diff --git a/lib/main.dart b/lib/main.dart index d536b7d4c..5bdc64710 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -73,7 +73,7 @@ import 'package:stackwallet/utilities/prefs.dart'; import 'package:stackwallet/utilities/stack_file_system.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/wallets/isar/providers/all_wallets_info_provider.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/crypto_notifications.dart'; import 'package:window_size/window_size.dart'; @@ -103,7 +103,7 @@ void main(List args) async { } if (Util.isDesktop && !Platform.isIOS) { - setWindowTitle(WhiteLabel.appName); + setWindowTitle(AppConfig.appName); setWindowMinSize(const Size(1220, 100)); setWindowMaxSize(Size.infinite); @@ -618,7 +618,7 @@ class _MaterialAppWithThemeState extends ConsumerState return MaterialApp( key: GlobalKey(), navigatorKey: navigatorKey, - title: WhiteLabel.appName, + title: AppConfig.appName, onGenerateRoute: RouteGenerator.generateRoute, theme: ThemeData( extensions: [colorScheme], diff --git a/lib/pages/address_book_views/address_book_view.dart b/lib/pages/address_book_views/address_book_view.dart index 8bc82f49e..bd39a26a4 100644 --- a/lib/pages/address_book_views/address_book_view.dart +++ b/lib/pages/address_book_views/address_book_view.dart @@ -26,7 +26,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/address_book_card.dart'; import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; @@ -108,7 +108,7 @@ class _AddressBookViewState extends ConsumerState { ); } final self = ContactEntry( - name: "My ${WhiteLabel.prefix}", + name: "My ${AppConfig.prefix}", addresses: addresses, isFavorite: true, customId: "default", diff --git a/lib/pages/exchange_view/exchange_step_views/step_4_view.dart b/lib/pages/exchange_view/exchange_step_views/step_4_view.dart index ba8a3871a..bbacf47ef 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_4_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_4_view.dart @@ -37,7 +37,7 @@ import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart'; import 'package:stackwallet/wallets/models/tx_data.dart'; import 'package:stackwallet/wallets/wallet/impl/firo_wallet.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/desktop/secondary_button.dart'; @@ -817,7 +817,7 @@ class _Step4ViewState extends ConsumerState { Builder( builder: (context) { String buttonTitle = - "Send from {$WhiteLabel.appName}"; + "Send from {$AppConfig.appName}"; final tuple = ref .read( diff --git a/lib/pages/home_view/home_view.dart b/lib/pages/home_view/home_view.dart index 9d3a404a5..94987200c 100644 --- a/lib/pages/home_view/home_view.dart +++ b/lib/pages/home_view/home_view.dart @@ -30,7 +30,7 @@ import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/animated_widgets/rotate_icon.dart'; import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; @@ -203,7 +203,7 @@ class _HomeViewState extends ConsumerState { width: 16, ), Text( - "My ${WhiteLabel.prefix}", + "My ${AppConfig.prefix}", style: STextStyles.navBarTitle(context), ) ], diff --git a/lib/pages/intro_view.dart b/lib/pages/intro_view.dart index 790c8d348..eba0f7b1c 100644 --- a/lib/pages/intro_view.dart +++ b/lib/pages/intro_view.dart @@ -21,7 +21,7 @@ import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/prefs.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/desktop/secondary_button.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -200,7 +200,7 @@ class AppNameText extends StatelessWidget { @override Widget build(BuildContext context) { return Text( - WhiteLabel.appName, + AppConfig.appName, // TODO [prio=high]: appName is now static due to `'appName' can't be // accessed using static access.`", check that that doesn't cause issues // elsewhere. @@ -247,7 +247,7 @@ class PrivacyAndTOSText extends StatelessWidget { text: TextSpan( style: STextStyles.label(context).copyWith(fontSize: fontSize), children: [ - TextSpan(text: "By using ${WhiteLabel.appName}, you agree to the "), + TextSpan(text: "By using ${AppConfig.appName}, you agree to the "), TextSpan( text: "Terms of service", style: STextStyles.richLink(context).copyWith(fontSize: fontSize), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart index dde6cb76c..b337b6068 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart @@ -26,7 +26,7 @@ import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; @@ -537,7 +537,7 @@ class _RestoreFromFileViewState extends ConsumerState { .all( 32), child: Text( - "Restore {$WhiteLabel.appName}", + "Restore {$AppConfig.appName}", style: STextStyles .desktopH3( context), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart index ce4b7c665..bbb97c0dd 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart @@ -32,7 +32,7 @@ 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/util.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/desktop/primary_button.dart'; @@ -264,7 +264,7 @@ class _StackRestoreProgressViewState }, ), title: Text( - "Restoring {$WhiteLabel.appName}", + "Restoring {$AppConfig.appName}", style: STextStyles.navBarTitle(context), ), ), diff --git a/lib/pages/settings_views/global_settings_view/support_view.dart b/lib/pages/settings_views/global_settings_view/support_view.dart index 247264464..be9e2d665 100644 --- a/lib/pages/settings_views/global_settings_view/support_view.dart +++ b/lib/pages/settings_views/global_settings_view/support_view.dart @@ -15,7 +15,7 @@ import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; @@ -89,7 +89,7 @@ class SupportView extends StatelessWidget { AboutItem( linkUrl: "https://discord.com/invite/mRPZuXx3At", label: "Discord", - buttonText: WhiteLabel.appName, + buttonText: AppConfig.appName, iconAsset: Assets.socials.discord, isDesktop: isDesktop, ), diff --git a/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart b/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart index 1fdf0eb8c..302b8ac0d 100644 --- a/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart +++ b/lib/pages_desktop_specific/address_book_view/desktop_address_book.dart @@ -28,7 +28,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/address_book_card.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; @@ -140,7 +140,7 @@ class _DesktopAddressBook extends ConsumerState { ); } final self = ContactEntry( - name: "My ${WhiteLabel.prefix}", + name: "My ${AppConfig.prefix}", addresses: addresses, isFavorite: true, customId: "default", diff --git a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart index bb4390a4f..38f2db774 100644 --- a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart +++ b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/step_scaffold.dart @@ -33,7 +33,7 @@ import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/exchange_rate_type_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/custom_loading_overlay.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; @@ -317,7 +317,7 @@ class _StepScaffoldState extends ConsumerState { onPressed: onBack, ), secondChild: SecondaryButton( - label: "Send from {$WhiteLabel.appName}", + label: "Send from {$AppConfig.appName}", buttonHeight: ButtonHeight.l, onPressed: sendFromStack, ), diff --git a/lib/pages_desktop_specific/desktop_menu.dart b/lib/pages_desktop_specific/desktop_menu.dart index a6f52a4cd..06f47cbd1 100644 --- a/lib/pages_desktop_specific/desktop_menu.dart +++ b/lib/pages_desktop_specific/desktop_menu.dart @@ -20,7 +20,7 @@ import 'package:stackwallet/providers/desktop/current_desktop_menu_item.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/text_styles.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/desktop/desktop_tor_status_button.dart'; import 'package:stackwallet/widgets/desktop/living_stack_icon.dart'; @@ -139,7 +139,7 @@ class _DesktopMenuState extends ConsumerState { child: SizedBox( height: 28, child: Text( - WhiteLabel.appName, + AppConfig.appName, style: STextStyles.desktopH2(context).copyWith( fontSize: 18, height: 23.4 / 18, @@ -181,7 +181,7 @@ class _DesktopMenuState extends ConsumerState { DesktopMenuItem( duration: duration, icon: const DesktopMyStackIcon(), - label: "My ${WhiteLabel.prefix}", + label: "My ${AppConfig.prefix}", value: DesktopMenuItemId.myStack, onChanged: updateSelectedMenuItem, controller: controllers[0], diff --git a/lib/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart b/lib/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart index c91e75836..0a1b2bdd0 100644 --- a/lib/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart +++ b/lib/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart @@ -12,7 +12,7 @@ import 'package:flutter/material.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; class ExitToMyStackButton extends StatelessWidget { const ExitToMyStackButton({ @@ -45,7 +45,7 @@ class ExitToMyStackButton extends StatelessWidget { horizontal: 30, ), child: Text( - "Exit to My ${WhiteLabel.prefix}", + "Exit to My ${AppConfig.prefix}", style: STextStyles.desktopButtonSmallSecondaryEnabled(context), ), ), diff --git a/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart b/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart index 05759019f..1d419193b 100644 --- a/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart +++ b/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart @@ -19,7 +19,7 @@ import 'package:stackwallet/pages_desktop_specific/my_stack_view/my_wallets.dart import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/wallets/isar/providers/all_wallets_info_provider.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/animated_widgets/rotate_icon.dart'; import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; @@ -132,7 +132,7 @@ class _DesktopMyStackTitleState extends ConsumerState { width: 12, ), Text( - "My ${WhiteLabel.prefix}", + "My ${AppConfig.prefix}", style: STextStyles.desktopH3(context), ) ], diff --git a/lib/pages_desktop_specific/password/desktop_login_view.dart b/lib/pages_desktop_specific/password/desktop_login_view.dart index b2ac42a73..e6ad79a8c 100644 --- a/lib/pages_desktop_specific/password/desktop_login_view.dart +++ b/lib/pages_desktop_specific/password/desktop_login_view.dart @@ -29,7 +29,7 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart'; import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart'; import 'package:stackwallet/widgets/desktop/primary_button.dart'; @@ -201,7 +201,7 @@ class _DesktopLoginViewState extends ConsumerState { height: 42, ), Text( - WhiteLabel.appName, + AppConfig.appName, style: STextStyles.desktopH1(context), ), const SizedBox( diff --git a/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart b/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart index 0734868b4..44c117702 100644 --- a/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart +++ b/lib/pages_desktop_specific/password/forgotten_passphrase_restore_from_swb.dart @@ -30,7 +30,7 @@ import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/text_styles.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart'; @@ -155,7 +155,7 @@ class _ForgottenPassphraseRestoreFromSWBState mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "Restoring {$WhiteLabel.appName}", + "Restoring {$AppConfig.appName}", style: STextStyles.desktopH3(context), ), ], diff --git a/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart b/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart index 35c7fb53d..23f0a6504 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart @@ -21,7 +21,7 @@ import 'package:package_info_plus/package_info_plus.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/text_styles.dart'; -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart'; @@ -166,7 +166,7 @@ class DesktopAboutView extends ConsumerWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - WhiteLabel.appName, + AppConfig.appName, style: STextStyles.desktopH3(context), textAlign: TextAlign.start, ), diff --git a/lib/utilities/featured_paynyms.dart b/lib/utilities/featured_paynyms.dart index e0771328f..41b7c6eb3 100644 --- a/lib/utilities/featured_paynyms.dart +++ b/lib/utilities/featured_paynyms.dart @@ -8,7 +8,7 @@ * */ -import 'package:stackwallet/whiteLabel.dart'; +import 'package:stackwallet/white_label.dart'; abstract class FeaturedPaynyms { // TODO: replace with actual value @@ -18,7 +18,7 @@ abstract class FeaturedPaynyms { "PM8TJdQcNk27JpxGRtNR7Hnh8VkJk4Nf17BthLx89fM3iX3UL2YshyaiTAvKgTCVvpgsAgY1DbojkAaUd3Rcn48NEn4uUBuqkaSddgKL8TPAAEQXNuE6"; static Map get featured => { - WhiteLabel.appName: stackWallet, + AppConfig.appName: stackWallet, // "Samourai Wallet Dev Fund": samouraiWalletDevFund, }; } diff --git a/lib/whiteLabel.dart b/lib/white_label.dart similarity index 86% rename from lib/whiteLabel.dart rename to lib/white_label.dart index 0e00e0e7a..123cf606c 100644 --- a/lib/whiteLabel.dart +++ b/lib/white_label.dart @@ -1,4 +1,4 @@ -abstract class WhiteLabel { +abstract class AppConfig { static String get appName => prefix + separator + suffix; static String get prefix => "Stack";