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: 4616 - no food preferences displayed in onboarding #4618

Closed
Closed
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
13 changes: 0 additions & 13 deletions packages/smooth_app/lib/pages/onboarding/preferences_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:openfoodfacts/openfoodfacts.dart';
import 'package:provider/provider.dart';
import 'package:smooth_app/data_models/onboarding_data_product.dart';
import 'package:smooth_app/data_models/preferences/user_preferences.dart';
import 'package:smooth_app/data_models/product_preferences.dart';
import 'package:smooth_app/database/local_database.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/helpers/app_helper.dart';
import 'package:smooth_app/pages/onboarding/next_button.dart';
import 'package:smooth_app/pages/onboarding/onboarding_flow_navigator.dart';
import 'package:smooth_app/pages/preferences/user_preferences_food.dart';
import 'package:smooth_app/pages/product/summary_card.dart';

class PreferencesPage extends StatefulWidget {
Expand Down Expand Up @@ -77,7 +75,6 @@ class _HelperState extends State<_Helper> {
Widget build(BuildContext context) {
final ProductPreferences productPreferences =
context.watch<ProductPreferences>();
final UserPreferences userPreferences = context.watch<UserPreferences>();
final AppLocalizations appLocalizations = AppLocalizations.of(context);
final List<Widget> pageData = <Widget>[
SvgPicture.asset(
Expand Down Expand Up @@ -112,16 +109,6 @@ class _HelperState extends State<_Helper> {
),
),
];
pageData.addAll(
UserPreferencesFood(
productPreferences: productPreferences,
setState: setState,
context: context,
userPreferences: userPreferences,
appLocalizations: appLocalizations,
themeData: Theme.of(context),
).getOnboardingContent(),
);
return ColoredBox(
color: widget.backgroundColor,
child: SafeArea(
Expand Down
6 changes: 4 additions & 2 deletions packages/smooth_app/lib/pages/product/summary_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class _SummaryCardState extends State<SummaryCard> with UpToDateMixin {
super.initState();
initUpToDate(widget._product, context.read<LocalDatabase>());
_questionsLayout = getUserQuestionsLayout(context.read<UserPreferences>());
if (ProductIncompleteCard.isProductIncomplete(upToDateProduct)) {
if (widget.isProductEditable &&
ProductIncompleteCard.isProductIncomplete(upToDateProduct)) {
AnalyticsHelper.trackEvent(
AnalyticsEvent.showFastTrackProductEditCard,
barcode: barcode,
Expand Down Expand Up @@ -356,7 +357,8 @@ class _SummaryCardState extends State<SummaryCard> with UpToDateMixin {
});
},
),
if (ProductIncompleteCard.isProductIncomplete(upToDateProduct))
if (widget.isProductEditable &&
ProductIncompleteCard.isProductIncomplete(upToDateProduct))
ProductIncompleteCard(product: upToDateProduct),
..._getAttributes(scoreAttributes),
if (widget.isFullVersion &&
Expand Down