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: String too long in nutrition edit #1524

Merged
merged 1 commit into from
Apr 8, 2022
Merged
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
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 @@ -431,7 +431,7 @@
"score_add_missing_nutrition_facts": "Add missing nutrition facts",
"score_add_missing_product_category": "Add missing product category",
"score_update_nutrition_facts": "Update nutrition facts",
"nutrition_page_title": "Product Nutrition Facts",
"nutrition_page_title": "Nutrition Facts",
"nutrition_page_unspecified": "Nutrition facts are not specified on the product",
"nutrition_page_per_100g": "per 100g",
"nutrition_page_per_serving": "per serving",
Expand Down
4 changes: 3 additions & 1 deletion packages/smooth_app/lib/pages/product/edit_product_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:openfoodfacts/model/Product.dart';
Expand All @@ -22,8 +23,9 @@ class _EditProductPageState extends State<EditProductPage> {
final AppLocalizations appLocalizations = AppLocalizations.of(context)!;
return Scaffold(
appBar: AppBar(
title: Text(
title: AutoSizeText(
widget.product.productName ?? appLocalizations.unknownProductName,
maxLines: 2,
),
),
body: WillPopScope(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ class _NutritionPageLoadedState extends State<NutritionPageLoaded> {
return WillPopScope(
child: Scaffold(
appBar: AppBar(
title: Text(localizations.nutrition_page_title),
title: AutoSizeText(
localizations.nutrition_page_title,
maxLines: 2,
),
actions: <Widget>[
IconButton(
onPressed: () => _validateAndSave(localizations, localDatabase),
Expand Down