Skip to content

Commit

Permalink
fix: Revamp of the about screen openfoodfacts#4412 openfoodfacts#4457
Browse files Browse the repository at this point in the history
…updated design
  • Loading branch information
ADILAYOUB committed Aug 6, 2023
1 parent fe29237 commit a5a18bd
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/smooth_app/lib/pages/preferences/user_preferences_faq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,19 @@ class UserPreferencesFaq extends AbstractUserPreferences {
final IconData? trailing,
final String? url,
final VoidCallback? onTap,
}) =>
UserPreferencesListTile(
title: Text(title),
onTap: onTap ?? () async => LaunchUrlHelper.launchURL(url!, false),
trailing: trailing != null
? Icon(trailing) // Use the Icon widget directly with the IconData.
: null,
);
}) {
final IconData trailingIcon = trailing ?? Icons.open_in_new;

return UserPreferencesListTile(
title: Text(title),
onTap: onTap ??
(url != null
? () async => LaunchUrlHelper.launchURL(url, false)
: null),
trailing: Icon(trailingIcon),
);
}

ConstantIcons constantIcons = ConstantIcons.instance;
static const String _iconLightAssetPath =
'assets/app/release_icon_light_transparent_no_border.svg';
Expand Down Expand Up @@ -162,15 +167,13 @@ class UserPreferencesFaq extends AbstractUserPreferences {
),
_getAboutListTile(
title: appLocalizations.learnMore,
trailing: constantIcons.getForwardIcon(),
onTap: () => LaunchUrlHelper.launchURL(
'https://openfoodfacts.org/who-we-are',
true,
),
),
_getAboutListTile(
title: appLocalizations.termsOfUse,
trailing: constantIcons.getForwardIcon(),
onTap: () => LaunchUrlHelper.launchURL(
'https://openfoodfacts.org/terms-of-use',
false,
Expand Down

0 comments on commit a5a18bd

Please sign in to comment.