diff --git a/android/app/src/main/java/com/mindful/android/utils/Utils.java b/android/app/src/main/java/com/mindful/android/utils/Utils.java index 5ccd762..d474ab0 100644 --- a/android/app/src/main/java/com/mindful/android/utils/Utils.java +++ b/android/app/src/main/java/com/mindful/android/utils/Utils.java @@ -79,7 +79,7 @@ public static Map getDeviceInfoMap(@NonNull Context context) { PackageInfo packageInfo = packageManager.getPackageInfo(packageName, 0); appVersion = packageName.contains(".debug") - ? "DEBUG " + "v" + packageInfo.versionName + "+" + packageInfo.versionCode + ? "v" + packageInfo.versionName + "-debug+" + packageInfo.versionCode : "v" + packageInfo.versionName + "+" + packageInfo.versionCode; } catch (PackageManager.NameNotFoundException e) { Log.e(TAG, "getDeviceInfoMap: Error in fetching app version", e); diff --git a/lib/core/database/tables/mindful_settings_table.dart b/lib/core/database/tables/mindful_settings_table.dart index e0ce65c..80ff38f 100644 --- a/lib/core/database/tables/mindful_settings_table.dart +++ b/lib/core/database/tables/mindful_settings_table.dart @@ -14,6 +14,7 @@ import 'package:mindful/core/database/app_database.dart'; import 'package:mindful/core/database/converters/list_converters.dart'; import 'package:mindful/core/enums/app_theme_mode.dart'; import 'package:mindful/core/enums/default_home_tab.dart'; +import 'package:mindful/core/utils/app_constants.dart'; @DataClassName("MindfulSettings") class MindfulSettingsTable extends Table { @@ -65,10 +66,10 @@ class MindfulSettingsTable extends Table { static final defaultMindfulSettingsModel = MindfulSettings( id: 0, defaultHomeTab: DefaultHomeTab.dashboard, - themeMode: AppThemeMode.system, - accentColor: "Indigo", - username: "Hustler", - localeCode: "en", + themeMode: AppConstants.defaultThemeMode, + accentColor: AppConstants.defaultMaterialColor, + username: AppConstants.defaultUsername, + localeCode: AppConstants.defaultLocale, dataResetTime: const TimeOfDayAdapter.zero(), useBottomNavigation: false, useAmoledDark: false, diff --git a/lib/core/utils/app_constants.dart b/lib/core/utils/app_constants.dart index 47dae7b..f6fef10 100644 --- a/lib/core/utils/app_constants.dart +++ b/lib/core/utils/app_constants.dart @@ -17,7 +17,7 @@ class AppConstants { static const defaultThemeMode = AppThemeMode.system; static const defaultMaterialColor = "Indigo"; static const defaultLocale = "en"; - static const defaultUsername = "Hustler"; + static const defaultUsername = "Achiever"; static const defaultCurve = Curves.fastEaseInToSlowEaseOut; static const defaultAnimDuration = Duration(milliseconds: 350); @@ -37,8 +37,7 @@ class AppConstants { static const githubSuggestionDirectUrl = "https://github.com/akaMrNagar/Mindful/issues/new?template=feature_request.md"; - static const githubDonationSectionUrl = - "https://github.com/akaMrNagar/Mindful/blob/main/README.md#donate-"; + static const buyMeCoffeeDonationUrl = "https://buymeacoffee.com/akamrnagar"; static const githubFeedbackSectionUrl = "https://github.com/akaMrNagar/Mindful/blob/main/README.md#feedback-and-support"; diff --git a/lib/ui/common/sliver_flexible_appbar.dart b/lib/ui/common/sliver_flexible_appbar.dart index b381711..c734873 100644 --- a/lib/ui/common/sliver_flexible_appbar.dart +++ b/lib/ui/common/sliver_flexible_appbar.dart @@ -58,6 +58,9 @@ class SliverFlexibleAppBar extends ConsumerWidget { final useBottomNavigation = ref.watch(mindfulSettingsProvider.select((v) => v.useBottomNavigation)); + final showDevTag = + appVersion.contains('debug') || appVersion.contains('beta'); + return SliverAppBar( expandedHeight: 132, elevation: 0, @@ -91,21 +94,22 @@ class SliverFlexibleAppBar extends ConsumerWidget { ), /// Beta tag - DefaultHero( - tag: HeroTags.betaWarningTag, - child: RoundedContainer( - width: 56, - height: 24, - circularRadius: 8, - color: Theme.of(context).colorScheme.primary, - onPressed: () => _showBetaDialog(context, appVersion), - child: StyledText( - appVersion.contains('DEBUG') ? "DEBUG" : "BETA", - color: Theme.of(context).colorScheme.onPrimary, - overflow: TextOverflow.fade, + if (showDevTag) + DefaultHero( + tag: HeroTags.betaWarningTag, + child: RoundedContainer( + width: 56, + height: 24, + circularRadius: 8, + color: Theme.of(context).colorScheme.primary, + onPressed: () => _showBetaDialog(context, appVersion), + child: StyledText( + appVersion.contains('debug') ? "DEBUG" : "BETA", + color: Theme.of(context).colorScheme.onPrimary, + overflow: TextOverflow.fade, + ), ), ), - ), 24.vBox ], ), diff --git a/lib/ui/dialogs/input_field_dialog.dart b/lib/ui/dialogs/input_field_dialog.dart index 36d3c47..b3641e7 100644 --- a/lib/ui/dialogs/input_field_dialog.dart +++ b/lib/ui/dialogs/input_field_dialog.dart @@ -11,6 +11,7 @@ import 'package:fluentui_system_icons/fluentui_system_icons.dart'; import 'package:flutter/material.dart'; import 'package:mindful/core/extensions/ext_build_context.dart'; +import 'package:mindful/core/utils/app_constants.dart'; import 'package:mindful/ui/transitions/default_hero.dart'; import 'package:mindful/ui/transitions/hero_page_route.dart'; import 'package:mindful/ui/common/styled_text.dart'; @@ -58,7 +59,7 @@ Future showUsernameInputDialog({ fieldIcon: FluentIcons.person_20_regular, title: context.locale.username_dialog_title, fieldLabel: context.locale.username_dialog_title, - hintText: "Hustler", + hintText: AppConstants.defaultUsername, helperText: context.locale.username_dialog_info, negativeBtnLabel: context.locale.dialog_button_cancel, positiveBtnLabel: context.locale.username_dialog_button_apply, diff --git a/lib/ui/screens/settings/about/tab_about.dart b/lib/ui/screens/settings/about/tab_about.dart index 11c678a..dbc8308 100644 --- a/lib/ui/screens/settings/about/tab_about.dart +++ b/lib/ui/screens/settings/about/tab_about.dart @@ -88,7 +88,7 @@ class TabAbout extends ConsumerWidget { icon: const Icon(FluentIcons.heart_20_filled), label: Text(context.locale.donation_card_button_donate), onPressed: () => MethodChannelService.instance - .launchUrl(AppConstants.githubDonationSectionUrl), + .launchUrl(AppConstants.buyMeCoffeeDonationUrl), ), ),