Skip to content
Open
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
Binary file added packages/smooth_app/assets/icons/privacy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/smooth_app/assets/icons/svg-privacy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
"myPreferences_settings_subtitle": "Dark mode, Languages…",
"myPreferences_food_title": "Food Preferences",
"myPreferences_food_subtitle": "Choose what information about food matters most to you.",
"myPreferences_food_comment": "Choose what information about food matters most to you, in order to rank food according to your preferences, see the information you care about first, and get a compatibility summary. Those food preferences stay on your device, and are not associated with your OpenFoodFacts contributor account if you have one.",
"myPreferences_food_comment": "Choose the food preferences that matter most. They rank foods and provide a compatibility summary. Your preferences are stored on your device and aren’t linked to your Open Food Facts account.",
"confirmResetPreferences": "Reset your food preferences?",
"@confirmResetPreferences": {
"description": "Pop up title: Reassuring if the food preferences should really be reset"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_svg/svg.dart';
import 'package:openfoodfacts/openfoodfacts.dart';
import 'package:provider/provider.dart';
import 'package:smooth_app/data_models/product_preferences.dart';
Expand All @@ -11,9 +13,7 @@ import 'package:smooth_app/pages/preferences/user_preferences_item.dart';
import 'package:smooth_app/pages/preferences/user_preferences_list_tile.dart';
import 'package:smooth_app/pages/preferences/user_preferences_page.dart';
import 'package:smooth_app/pages/preferences/user_preferences_widgets.dart';
import 'package:smooth_app/widgets/smooth_text.dart';

/// Collapsed/expanded display of attribute groups for the preferences page.
class UserPreferencesFood extends AbstractUserPreferences {
UserPreferencesFood({
required this.productPreferences,
Expand Down Expand Up @@ -130,12 +130,36 @@ class UserPreferencesFood extends AbstractUserPreferences {
final List<UserPreferencesItem> result = <UserPreferencesItem>[
UserPreferencesItemSimple(
labels: <String>[appLocalizations.myPreferences_food_comment],
builder: (_) => ListTile(
title: Text(
appLocalizations.myPreferences_food_comment,
style: WellSpacedTextHelper.TEXT_STYLE_WITH_WELL_SPACED,
),
),
builder: (final BuildContext context) {
final ColorScheme colorScheme = Theme.of(context).colorScheme;
return Container(
color: colorScheme.tertiary,
width: double.infinity,
padding: const EdgeInsets.all(LARGE_SPACE),
margin: const EdgeInsets.all(LARGE_SPACE),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SvgPicture.asset(
'assets/icons/svg-privacy.svg',
colorFilter:
ColorFilter.mode(colorScheme.onTertiary, BlendMode.srcIn),
width: 32,
height: 32,
),
const SizedBox(width: MEDIUM_SPACE),
Expanded(
child: Text(
appLocalizations.myPreferences_food_comment,
style: TextStyle(
color: colorScheme.onTertiary,
),
),
),
],
),
);
},
),
];
for (final AttributeGroup group in groups) {
Expand Down
11 changes: 11 additions & 0 deletions packages/smooth_app/lib/themes/color_schemes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const ColorScheme lightColorScheme = ColorScheme(
onError: Color(0xFFFFFFFF),
surface: Color(0xFFFFFFFF),
onSurface: Color(0xFF000000),
tertiary: privacyBox,
onTertiary: onprivacyBox,
);

const ColorScheme darkColorScheme = ColorScheme(
Expand All @@ -27,6 +29,8 @@ const ColorScheme darkColorScheme = ColorScheme(
onError: Color(0xFFFFFFFF),
surface: Color(0xFF201A17),
onSurface: Color(0xFFFFFFFF),
tertiary: privacyBoxDark,
onTertiary: onprivacyBoxDark,
);

const ColorScheme trueDarkColorScheme = ColorScheme(
Expand All @@ -40,6 +44,8 @@ const ColorScheme trueDarkColorScheme = ColorScheme(
onError: Color(0xFFE1E1E1),
surface: Color(0xFF000000),
onSurface: Color(0xFFFFFFFF),
tertiary: privacyBoxDark,
onTertiary: onprivacyBoxDark,
);

const String CONTRAST_LOW = 'Low';
Expand All @@ -53,6 +59,11 @@ const Color HIGH_CONTRAST_TEXT_COLOR = Color(0xffffffff);

const Color Test = Colors.white10;

const Color privacyBox = Color(0xFF1E3A5F);
const Color privacyBoxDark = Color(0xFF0C3975);
const Color onprivacyBox = Color(0xFFF0F0F0);
const Color onprivacyBoxDark = Color(0xFFF0F0F0);

const String COLOR_DEFAULT_NAME = 'Default';
const Color COLOR_DEFAULT = Color(0xff85746c);
const Color COLOR_BLUE = Colors.blue;
Expand Down