Skip to content

Commit

Permalink
fix: golden screenshots and local database (#951)
Browse files Browse the repository at this point in the history
Impacted files:
* `user_preferences_dev_mode.dart`: now getting `LocalDatabase` from `read`, not as parameter
* `user_preferences_page.dart`: removed reference to `LocalDatabase`
* `user_preferences_page-blue-dark.png`
* `user_preferences_page-blue-light.png`
* `user_preferences_page-brown-dark.png`
* `user_preferences_page-brown-light.png`
* `user_preferences_page-green-dark.png`
* `user_preferences_page-green-light.png`
  • Loading branch information
monsieurtanuki authored Jan 14, 2022
1 parent 6d84015 commit 4eccfbe
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/smooth_app/lib/pages/user_preferences_dev_mode.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:openfoodfacts/utils/OpenFoodAPIConfiguration.dart';
import 'package:provider/provider.dart';
import 'package:smooth_app/data_models/product_list.dart';
import 'package:smooth_app/data_models/user_preferences.dart';
import 'package:smooth_app/database/dao_product_list.dart';
Expand All @@ -25,7 +26,6 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
required final UserPreferences userPreferences,
required final AppLocalizations appLocalizations,
required final ThemeData themeData,
required this.localDatabase,
}) : super(
setState: setState,
context: context,
Expand All @@ -34,8 +34,6 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
themeData: themeData,
);

final LocalDatabase localDatabase;

static const String userPreferencesFlagProd = '__devWorkingOnProd';
static const String userPreferencesFlagUseMLKit = '__useMLKit';

Expand Down Expand Up @@ -106,6 +104,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
ListTile(
title: const Text('export history'),
onTap: () async {
final LocalDatabase localDatabase = context.read<LocalDatabase>();
final Map<String, dynamic> export =
await DaoProductList(localDatabase).export(
ProductList.history(),
Expand Down
3 changes: 0 additions & 3 deletions packages/smooth_app/lib/pages/user_preferences_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:smooth_app/data_models/product_preferences.dart';
import 'package:smooth_app/data_models/user_preferences.dart';
import 'package:smooth_app/database/local_database.dart';
import 'package:smooth_app/pages/abstract_user_preferences.dart';
import 'package:smooth_app/pages/user_preferences_dev_mode.dart';
import 'package:smooth_app/pages/user_preferences_food.dart';
Expand All @@ -24,7 +23,6 @@ class _UserPreferencesPageState extends State<UserPreferencesPage> {
Widget build(BuildContext context) {
final AppLocalizations appLocalizations = AppLocalizations.of(context)!;
final UserPreferences userPreferences = context.watch<UserPreferences>();
final LocalDatabase localDatabase = context.watch<LocalDatabase>();
final ThemeProvider themeProvider = context.watch<ThemeProvider>();
final ThemeData themeData = Theme.of(context);
final ProductPreferences productPreferences =
Expand Down Expand Up @@ -63,7 +61,6 @@ class _UserPreferencesPageState extends State<UserPreferencesPage> {
userPreferences: userPreferences,
appLocalizations: appLocalizations,
themeData: themeData,
localDatabase: localDatabase,
),
);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4eccfbe

Please sign in to comment.