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

fix: Unable to view details of product after scanning #1726

Merged
merged 7 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ProductTitleCard extends StatelessWidget {
final Widget trailingWidget;
final String brands = product.brands ?? appLocalizations.unknownBrand;
final String quantity = product.quantity ?? '';
if (isRemovable) {
if (isRemovable && !isSelectable) {
final ContinuousScanModel model = context.watch<ContinuousScanModel>();
subtitleText = '$brands${quantity == '' ? '' : ', $quantity'}';
trailingWidget = InkWell(
Expand Down
4 changes: 4 additions & 0 deletions packages/smooth_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:openfoodfacts/utils/OpenFoodAPIConfiguration.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:smooth_app/data_models/continuous_scan_model.dart';
import 'package:smooth_app/data_models/product_preferences.dart';
import 'package:smooth_app/data_models/user_management_provider.dart';
import 'package:smooth_app/data_models/user_preferences.dart';
Expand Down Expand Up @@ -110,6 +111,8 @@ class _SmoothAppState extends State<SmoothApp> {
final UserManagementProvider _userManagementProvider =
UserManagementProvider();

final ContinuousScanModel _continuousScanModel = ContinuousScanModel();
bhattabhi013 marked this conversation as resolved.
Show resolved Hide resolved

bool systemDarkmodeOn = false;
final Brightness brightness =
SchedulerBinding.instance?.window.platformBrightness ?? Brightness.light;
Expand Down Expand Up @@ -167,6 +170,7 @@ class _SmoothAppState extends State<SmoothApp> {
provide<LocalDatabase>(_localDatabase),
provide<ThemeProvider>(_themeProvider),
provide<UserManagementProvider>(_userManagementProvider),
provide<ContinuousScanModel>(_continuousScanModel),
],
builder: _buildApp,
);
Expand Down