Skip to content

Commit

Permalink
fix: String too long in nutrition edit
Browse files Browse the repository at this point in the history
  • Loading branch information
bhattabhi013 committed Apr 8, 2022
1 parent 4449a9f commit 52efd7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
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

0 comments on commit 52efd7f

Please sign in to comment.