diff --git a/packages/smooth_app/lib/l10n/app_en.arb b/packages/smooth_app/lib/l10n/app_en.arb index 994bbb03c6a0..bc9a893d1f6f 100644 --- a/packages/smooth_app/lib/l10n/app_en.arb +++ b/packages/smooth_app/lib/l10n/app_en.arb @@ -2233,8 +2233,15 @@ "prices_proof_mandatory": "You need to select a proof!", "prices_add_validation_error": "Validation error", "prices_privacy_warning_title": "Privacy warning", - "prices_privacy_warning_message": "Prices will be public, along with the store they refer to.\nThat might allow people who know about your Open Food Facts pseudonym to:\n* infer in which area you live\n* know what you are buying\nIf you are uneasy with that, please change your pseudonym, or create a new Open Food Facts account and log into the app with it.", "prices_unknown_product": "Unknown product", + "prices_privacy_warning_title": "Privacy warning", + "prices_unknown_product": "Unknown product", + "prices_privacy_warning_main_message": "Prices **will be public**, along with the store they refer to.\n\nThat might allow people who know about your Open Food Facts pseudonym to:\n", + "prices_privacy_warning_message_bullet_1": "Infer in which area you live", + "prices_privacy_warning_message_bullet_2": "Know what you are buying", + "prices_privacy_warning_sub_message": "If you are uneasy with that, please change your pseudonym, or create a new Open Food Facts account and log into the app with it.", + "i_refuse": "I refuse", + "i_accept": "I accept", "prices_currency_change_proposal_title": "Change the currency?", "prices_currency_change_proposal_message": "Your current currency is **{currency}**. Would you like to change it to **{newCurrency}**?", "@prices_currency_change_proposal_message": { diff --git a/packages/smooth_app/lib/pages/prices/product_price_add_page.dart b/packages/smooth_app/lib/pages/prices/product_price_add_page.dart index 729fc6e9c953..6d840495a4af 100644 --- a/packages/smooth_app/lib/pages/prices/product_price_add_page.dart +++ b/packages/smooth_app/lib/pages/prices/product_price_add_page.dart @@ -22,6 +22,7 @@ import 'package:smooth_app/pages/prices/price_model.dart'; import 'package:smooth_app/pages/prices/price_proof_card.dart'; import 'package:smooth_app/pages/product/common/product_refresher.dart'; import 'package:smooth_app/pages/product/may_exit_page_helper.dart'; +import 'package:smooth_app/resources/app_icons.dart' as app_icons; import 'package:smooth_app/themes/smooth_theme.dart'; import 'package:smooth_app/themes/smooth_theme_colors.dart'; import 'package:smooth_app/themes/theme_provider.dart'; @@ -236,23 +237,89 @@ class _ProductPriceAddPageState extends State Future _doesAcceptWarning({required final bool justInfo}) async { final AppLocalizations appLocalizations = AppLocalizations.of(context); - return showDialog( + const Color color = Color(0xFFB81D1D); + final SmoothColorsThemeExtension extension = + context.extension(); + return showSmoothListOfChoicesModalSheet( + safeArea: true, context: context, - builder: (final BuildContext context) => SmoothAlertDialog( - title: appLocalizations.prices_privacy_warning_title, - actionsAxis: Axis.vertical, - body: Text(appLocalizations.prices_privacy_warning_message), - positiveAction: SmoothActionButton( - text: appLocalizations.okay, - onPressed: () => Navigator.of(context).pop(true), + headerBackgroundColor: color, + header: Padding( + padding: const EdgeInsetsDirectional.symmetric( + horizontal: LARGE_SPACE, + vertical: MEDIUM_SPACE, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + TextWithBoldParts( + text: appLocalizations.prices_privacy_warning_main_message, + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith( + fontWeight: FontWeight.w600, + ), + ), + _buildBulletPoint( + appLocalizations.prices_privacy_warning_message_bullet_1, + context, + ), + const SizedBox(height: MEDIUM_SPACE), + _buildBulletPoint( + appLocalizations.prices_privacy_warning_message_bullet_2, + context, + ), + const SizedBox(height: MEDIUM_SPACE), + Text( + appLocalizations.prices_privacy_warning_sub_message, + style: Theme.of(context).textTheme.bodyLarge?.copyWith( + fontWeight: FontWeight.w600, + ), + ), + ], ), - negativeAction: justInfo - ? null - : SmoothActionButton( - text: appLocalizations.cancel, - onPressed: () => Navigator.of(context).pop(), - ), ), + labels: [ + appLocalizations.i_accept, + appLocalizations.i_refuse, + ], + values: [ + true, + false, + ], + prefixIcons: [ + Icon(Icons.check_circle_rounded, color: extension.success), + Icon(Icons.cancel_rounded, color: extension.error), + ], + title: appLocalizations.prices_privacy_warning_title, + ); + } + + Widget _buildBulletPoint(String text, BuildContext context) { + const double defaultIconSize = 7.0; + const double radius = 10.0; + final SmoothColorsThemeExtension extension = + context.extension(); + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(width: MEDIUM_SPACE), + CircleAvatar( + radius: radius, + backgroundColor: extension.greyLight, + child: const app_icons.Arrow.right( + color: Colors.white, + size: defaultIconSize, + ), + ), + const SizedBox(width: SMALL_SPACE), + Expanded( + child: Text( + text, + style: Theme.of(context).textTheme.bodyLarge?.copyWith( + fontWeight: FontWeight.w600, + ), + ), + ), + ], ); }