From f0386a12bfdbfed8e63e8e5100bbb1c292f96a6d Mon Sep 17 00:00:00 2001 From: ADILAYOUB Date: Sun, 6 Aug 2023 23:48:45 +0530 Subject: [PATCH] fix: Revamp of the about screen #4412 #4457 updated design --- .../preferences/user_preferences_faq.dart | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/smooth_app/lib/pages/preferences/user_preferences_faq.dart b/packages/smooth_app/lib/pages/preferences/user_preferences_faq.dart index 21c330fd324..901aa49077f 100644 --- a/packages/smooth_app/lib/pages/preferences/user_preferences_faq.dart +++ b/packages/smooth_app/lib/pages/preferences/user_preferences_faq.dart @@ -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'; @@ -162,7 +167,6 @@ class UserPreferencesFaq extends AbstractUserPreferences { ), _getAboutListTile( title: appLocalizations.learnMore, - trailing: constantIcons.getForwardIcon(), onTap: () => LaunchUrlHelper.launchURL( 'https://openfoodfacts.org/who-we-are', true, @@ -170,7 +174,6 @@ class UserPreferencesFaq extends AbstractUserPreferences { ), _getAboutListTile( title: appLocalizations.termsOfUse, - trailing: constantIcons.getForwardIcon(), onTap: () => LaunchUrlHelper.launchURL( 'https://openfoodfacts.org/terms-of-use', false,