whiteLabel.dart -> app_config.dart

related rafactorings
This commit is contained in:
sneurlax 2024-05-13 14:44:19 -05:00
parent 56ea4b89be
commit b016c21140
18 changed files with 38 additions and 38 deletions

View file

@ -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<String> 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<MaterialAppWithTheme>
return MaterialApp(
key: GlobalKey(),
navigatorKey: navigatorKey,
title: WhiteLabel.appName,
title: AppConfig.appName,
onGenerateRoute: RouteGenerator.generateRoute,
theme: ThemeData(
extensions: [colorScheme],

View file

@ -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<AddressBookView> {
);
}
final self = ContactEntry(
name: "My ${WhiteLabel.prefix}",
name: "My ${AppConfig.prefix}",
addresses: addresses,
isFavorite: true,
customId: "default",

View file

@ -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<Step4View> {
Builder(
builder: (context) {
String buttonTitle =
"Send from {$WhiteLabel.appName}";
"Send from {$AppConfig.appName}";
final tuple = ref
.read(

View file

@ -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<HomeView> {
width: 16,
),
Text(
"My ${WhiteLabel.prefix}",
"My ${AppConfig.prefix}",
style: STextStyles.navBarTitle(context),
)
],

View file

@ -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),

View file

@ -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<RestoreFromFileView> {
.all(
32),
child: Text(
"Restore {$WhiteLabel.appName}",
"Restore {$AppConfig.appName}",
style: STextStyles
.desktopH3(
context),

View file

@ -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),
),
),

View file

@ -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,
),

View file

@ -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<DesktopAddressBook> {
);
}
final self = ContactEntry(
name: "My ${WhiteLabel.prefix}",
name: "My ${AppConfig.prefix}",
addresses: addresses,
isFavorite: true,
customId: "default",

View file

@ -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<StepScaffold> {
onPressed: onBack,
),
secondChild: SecondaryButton(
label: "Send from {$WhiteLabel.appName}",
label: "Send from {$AppConfig.appName}",
buttonHeight: ButtonHeight.l,
onPressed: sendFromStack,
),

View file

@ -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<DesktopMenu> {
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<DesktopMenu> {
DesktopMenuItem(
duration: duration,
icon: const DesktopMyStackIcon(),
label: "My ${WhiteLabel.prefix}",
label: "My ${AppConfig.prefix}",
value: DesktopMenuItemId.myStack,
onChanged: updateSelectedMenuItem,
controller: controllers[0],

View file

@ -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),
),
),

View file

@ -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<DesktopMyStackTitle> {
width: 12,
),
Text(
"My ${WhiteLabel.prefix}",
"My ${AppConfig.prefix}",
style: STextStyles.desktopH3(context),
)
],

View file

@ -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<DesktopLoginView> {
height: 42,
),
Text(
WhiteLabel.appName,
AppConfig.appName,
style: STextStyles.desktopH1(context),
),
const SizedBox(

View file

@ -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),
),
],

View file

@ -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,
),

View file

@ -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<String, String> get featured => {
WhiteLabel.appName: stackWallet,
AppConfig.appName: stackWallet,
// "Samourai Wallet Dev Fund": samouraiWalletDevFund,
};
}

View file

@ -1,4 +1,4 @@
abstract class WhiteLabel {
abstract class AppConfig {
static String get appName => prefix + separator + suffix;
static String get prefix => "Stack";