diff --git a/packages/smooth_app/lib/pages/product/add_basic_details_page.dart b/packages/smooth_app/lib/pages/product/add_basic_details_page.dart index 685baebdac5..05273acbff6 100644 --- a/packages/smooth_app/lib/pages/product/add_basic_details_page.dart +++ b/packages/smooth_app/lib/pages/product/add_basic_details_page.dart @@ -87,8 +87,10 @@ class _AddBasicDetailsPageState extends State { centerTitle: false, title: Text(appLocalizations.basic_details), subTitle: widget.product.productName != null - ? Text(widget.product.productName!, - overflow: TextOverflow.ellipsis, maxLines: 1) + ? Text( + '${widget.product.productName!.trim()}, ${widget.product.brands!.trim()}', + overflow: TextOverflow.ellipsis, + maxLines: 1) : null, ), body: Form( diff --git a/packages/smooth_app/lib/pages/product/add_other_details_page.dart b/packages/smooth_app/lib/pages/product/add_other_details_page.dart index 53a7ae863cf..12e982a21af 100644 --- a/packages/smooth_app/lib/pages/product/add_other_details_page.dart +++ b/packages/smooth_app/lib/pages/product/add_other_details_page.dart @@ -62,8 +62,10 @@ class _AddOtherDetailsPageState extends State { title: Text(appLocalizations.edit_product_form_item_other_details_title), subTitle: widget.product.productName != null - ? Text(widget.product.productName!, - overflow: TextOverflow.ellipsis, maxLines: 1) + ? Text( + '${widget.product.productName!.trim()}, ${widget.product.brands!.trim()}', + overflow: TextOverflow.ellipsis, + maxLines: 1) : null, ignoreSemanticsForSubtitle: true, ), diff --git a/packages/smooth_app/lib/pages/product/edit_new_packagings.dart b/packages/smooth_app/lib/pages/product/edit_new_packagings.dart index f57fad60f12..57c0a86e011 100644 --- a/packages/smooth_app/lib/pages/product/edit_new_packagings.dart +++ b/packages/smooth_app/lib/pages/product/edit_new_packagings.dart @@ -192,7 +192,7 @@ class _EditNewPackagingsState extends State title: Text(appLocalizations.edit_packagings_title), subTitle: upToDateProduct.productName != null ? Text( - upToDateProduct.productName!, + '${upToDateProduct.productName!.trim()}, ${upToDateProduct.brands!.trim()}', maxLines: 1, overflow: TextOverflow.ellipsis, ) diff --git a/packages/smooth_app/lib/pages/product/edit_ocr_page.dart b/packages/smooth_app/lib/pages/product/edit_ocr_page.dart index cacd8dfe178..597e44b718c 100644 --- a/packages/smooth_app/lib/pages/product/edit_ocr_page.dart +++ b/packages/smooth_app/lib/pages/product/edit_ocr_page.dart @@ -149,7 +149,7 @@ class _EditOcrPageState extends State with UpToDateMixin { ), subTitle: upToDateProduct.productName != null ? Text( - upToDateProduct.productName!, + '${upToDateProduct.productName!.trim()}, ${upToDateProduct.brands!.trim()}', maxLines: 1, overflow: TextOverflow.ellipsis, style: appbarTextStyle, diff --git a/packages/smooth_app/lib/pages/product/edit_product_page.dart b/packages/smooth_app/lib/pages/product/edit_product_page.dart index 9b2c43acf59..a71034a0579 100644 --- a/packages/smooth_app/lib/pages/product/edit_product_page.dart +++ b/packages/smooth_app/lib/pages/product/edit_product_page.dart @@ -60,6 +60,8 @@ class _EditProductPageState extends State with UpToDateMixin { upToDateProduct, appLocalizations, ); + final String productBrand = + getProductBrands(upToDateProduct, appLocalizations); return SmoothScaffold( appBar: SmoothAppBar( @@ -72,7 +74,7 @@ class _EditProductPageState extends State with UpToDateMixin { crossAxisAlignment: CrossAxisAlignment.start, children: [ AutoSizeText( - productName, + '${productName.trim()}, ${productBrand.trim()}', minFontSize: theme.textTheme.titleLarge?.fontSize?.clamp(13.0, 17.0) ?? 13.0, diff --git a/packages/smooth_app/lib/pages/product/nutrition_page_loaded.dart b/packages/smooth_app/lib/pages/product/nutrition_page_loaded.dart index 31bb73b2685..eb522c2961b 100644 --- a/packages/smooth_app/lib/pages/product/nutrition_page_loaded.dart +++ b/packages/smooth_app/lib/pages/product/nutrition_page_loaded.dart @@ -200,7 +200,7 @@ class _NutritionPageLoadedState extends State ), subTitle: upToDateProduct.productName != null ? Text( - upToDateProduct.productName!, + '${upToDateProduct.productName!.trim()}, ${upToDateProduct.brands!.trim()}', maxLines: 1, overflow: TextOverflow.ellipsis, ) diff --git a/packages/smooth_app/lib/pages/product/product_image_gallery_view.dart b/packages/smooth_app/lib/pages/product/product_image_gallery_view.dart index 472976aad79..cb8f003f01d 100644 --- a/packages/smooth_app/lib/pages/product/product_image_gallery_view.dart +++ b/packages/smooth_app/lib/pages/product/product_image_gallery_view.dart @@ -56,7 +56,7 @@ class _ProductImageGalleryViewState extends State subTitle: upToDateProduct.productName == null ? null : Text( - upToDateProduct.productName!, + '${upToDateProduct.productName!.trim()}, ${upToDateProduct.brands!.trim()}', overflow: TextOverflow.ellipsis, maxLines: 1, ), diff --git a/packages/smooth_app/lib/pages/product/simple_input_page.dart b/packages/smooth_app/lib/pages/product/simple_input_page.dart index 3da2b0903a5..cc902bf7e06 100644 --- a/packages/smooth_app/lib/pages/product/simple_input_page.dart +++ b/packages/smooth_app/lib/pages/product/simple_input_page.dart @@ -85,6 +85,10 @@ class _SimpleInputPageState extends State { ), ); } + final String productName = getProductName( + widget.product, + appLocalizations, + ); return WillPopScope( onWillPop: () async => _mayExitPage(saving: false), @@ -94,7 +98,7 @@ class _SimpleInputPageState extends State { appBar: SmoothAppBar( centerTitle: false, title: Text( - getProductName(widget.product, appLocalizations), + '${productName.trim()}, ${widget.product.brands!.trim()}', maxLines: widget.product.barcode?.isNotEmpty == true ? 1 : 2, overflow: TextOverflow.ellipsis, ),