Skip to content

Commit

Permalink
Ensure native settings / rate app / share app entries look the same (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k authored Jul 29, 2023
1 parent 82b1db0 commit 7f81b3d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,7 @@
"@show_password": {
"description": "Show hidden password in password field"
},
"rate_app": "Rate the app",
"app_rating_dialog_title": "Great! Let others know what you think of this app!",
"app_rating_dialog_positive_action": "Rate the app",
"app_rating_dialog_negative_action": "Later",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class _RateUs extends StatelessWidget {
child: Image.asset(getImagePath()),
);

final String title = appLocalizations.app_rating_dialog_positive_action;
final String title = appLocalizations.rate_app;

return UserPreferenceListTile(
title: title,
Expand Down Expand Up @@ -421,28 +421,14 @@ class _AdvancedSettings extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: ListTile(
onTap: () async {
child: UserPreferenceListTile(
onTap: (_) async {
await AppSettings.openAppSettings();
},
title: Text(
appLocalizations.native_app_settings,
style: Theme.of(context).textTheme.headlineMedium,
),
subtitle: Padding(
padding: const EdgeInsets.only(top: SMALL_SPACE),
child: Text(
appLocalizations.native_app_description,
style: Theme.of(context).textTheme.bodyMedium,
),
),
leading: const Padding(
padding: EdgeInsets.all(VERY_SMALL_SPACE),
child: Icon(
CupertinoIcons.settings_solid,
),
),
minVerticalPadding: MEDIUM_SPACE,
title: appLocalizations.native_app_settings,
subTitle: appLocalizations.native_app_description,
leading: const Icon(CupertinoIcons.settings_solid),
showDivider: true,
),
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,16 +379,20 @@ class UserPreferenceListTile extends StatelessWidget {
required this.leading,
required this.onTap,
required this.showDivider,
this.subTitle,
super.key,
});

final String title;
final String? subTitle;
final Widget leading;
final Future<void> Function(BuildContext) onTap;
final bool showDivider;

@override
Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).textTheme;

return Column(
children: <Widget>[
ListTile(
Expand All @@ -398,9 +402,19 @@ class UserPreferenceListTile extends StatelessWidget {
),
title: Text(
title,
style: const TextStyle(fontWeight: FontWeight.bold),
style: textTheme.headlineMedium,
),
subtitle: subTitle != null
? Text(
subTitle!,
style: textTheme.bodyMedium,
)
: null,
onTap: () => onTap(context),
contentPadding: const EdgeInsetsDirectional.symmetric(
horizontal: LARGE_SPACE,
vertical: SMALL_SPACE,
),
),
if (showDivider) const UserPreferencesListItemDivider(),
],
Expand Down

0 comments on commit 7f81b3d

Please sign in to comment.