Skip to content

Commit

Permalink
Update app strings and drawer menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
TechAurelian committed Apr 17, 2024
1 parent 9eeb10b commit 7ced52c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
7 changes: 3 additions & 4 deletions lib/common/app_strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppStrings {

static const String drawerTitle = appName;
static const String settingsItemTitle = 'Settings';
static const String helpItemTitle = 'Online Help';
static const String aboutItemTitle = 'About This App';
static const String rateItemTitle = 'Rate App';
static const String viewSourceItemTitle = 'View Source Code';

Expand All @@ -29,10 +29,9 @@ class AppStrings {

static String shareText(String name, String value) => 'The $name is $value';

static const String rateAppURL =
'https://play.google.com/store/apps/details?id=com.anaurelian.helloworldcounters';
static const String rateAppURL = 'https://appliberated.com/helloworldcounters/rate/';

static const String helpURL = 'https://appliberated.com/helloworldcounters/';
static const String aboutURL = 'https://appliberated.com/helloworldcounters/';

static const String viewSourceURL = 'https://github.com/Appliberated/hello_world_counters';

Expand Down
8 changes: 4 additions & 4 deletions lib/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class _HomeScreenState extends State<HomeScreen> {
Navigator.pop(context);
}

/// Performs the tasks of the popup menu items (reset, share, rate, and help).
/// Performs the tasks of the popup menu items (reset, share).
void popupMenuSelection(MenuAction item) {
switch (item) {
case MenuAction.reset:
Expand Down Expand Up @@ -81,9 +81,9 @@ class _HomeScreenState extends State<HomeScreen> {
// Load the Settings screen
_loadSettingsScreen();
break;
case DrawerExtraActions.help:
// Launch the app online help url
launchUrlExternal(context, AppStrings.helpURL);
case DrawerExtraActions.about:
// Launch the app's about page
launchUrlExternal(context, AppStrings.aboutURL);
break;
case DrawerExtraActions.rate:
// Launch the Google Play Store page to allow the user to rate the app
Expand Down
21 changes: 9 additions & 12 deletions lib/widgets/counters_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import '../utils/utils.dart';
import 'color_list_tile.dart';

/// Drawer extra actions enumeration.
enum DrawerExtraActions { settings, help, rate, viewSource }
enum DrawerExtraActions { settings, about, rate, viewSource }

/// A material design drawer that shows navigation links for all available counters.
class CountersDrawer extends StatelessWidget {
Expand Down Expand Up @@ -42,8 +42,6 @@ class CountersDrawer extends StatelessWidget {

@override
Widget build(BuildContext context) {
final bool isAndroid = Theme.of(context).platform == TargetPlatform.android;

return Drawer(
child: ListTileTheme(
selectedColor: Colors.black,
Expand All @@ -59,21 +57,20 @@ class CountersDrawer extends StatelessWidget {
),
ListTile(
leading: const Icon(Icons.help_outline),
title: const Text(AppStrings.helpItemTitle),
onTap: () => _onExtraActionTap(context, DrawerExtraActions.help),
title: const Text(AppStrings.aboutItemTitle),
onTap: () => _onExtraActionTap(context, DrawerExtraActions.about),
),
ListTile(
leading: const Icon(Icons.flutter_dash),
title: const Text(AppStrings.viewSourceItemTitle),
onTap: () => _onExtraActionTap(context, DrawerExtraActions.viewSource),
),
if (isAndroid) const Divider(),
if (isAndroid)
ListTile(
leading: const Icon(Icons.rate_review_outlined),
title: const Text(AppStrings.rateItemTitle),
onTap: () => _onExtraActionTap(context, DrawerExtraActions.rate),
),
const Divider(),
ListTile(
leading: const Icon(Icons.stars),
title: const Text(AppStrings.rateItemTitle),
onTap: () => _onExtraActionTap(context, DrawerExtraActions.rate),
),
],
),
),
Expand Down

0 comments on commit 7ced52c

Please sign in to comment.