Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Ensure native settings / rate app / share app entries look the same #4388

Merged
merged 1 commit into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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