diff --git a/packages/smooth_app/lib/pages/product/gallery_view/product_image_gallery_tabs.dart b/packages/smooth_app/lib/pages/product/gallery_view/product_image_gallery_tabs.dart index c2e97846bfe..f5713f25237 100644 --- a/packages/smooth_app/lib/pages/product/gallery_view/product_image_gallery_tabs.dart +++ b/packages/smooth_app/lib/pages/product/gallery_view/product_image_gallery_tabs.dart @@ -237,7 +237,7 @@ class _ImageGalleryLanguagesProvider Product? product; void attachProduct(final Product product) { - if (product != this.product) { + if (!equalsProduct(product)) { this.product = product; refreshLanguages(initial: true); } @@ -311,6 +311,33 @@ class _ImageGalleryLanguagesProvider hasNewLanguage: false, ); } + + bool equalsProduct(Product product) { + if (this.product == null) { + return false; + } + + return product.barcode == this.product!.barcode && + product.productType == this.product!.productType && + product.imageFrontUrl == this.product!.imageFrontUrl && + product.imageFrontSmallUrl == this.product!.imageFrontSmallUrl && + product.imageIngredientsUrl == this.product!.imageIngredientsUrl && + product.imageIngredientsSmallUrl == + this.product!.imageIngredientsSmallUrl && + product.imageNutritionUrl == this.product!.imageNutritionUrl && + product.imageNutritionSmallUrl == + this.product!.imageNutritionSmallUrl && + product.imagePackagingUrl == this.product!.imagePackagingUrl && + product.imagePackagingSmallUrl == + this.product!.imagePackagingSmallUrl && + const ListEquality() + .equals(product.selectedImages, this.product!.selectedImages) && + const ListEquality() + .equals(product.images, this.product!.images) && + product.lastImage == this.product!.lastImage && + const ListEquality() + .equals(product.lastImageDates, this.product!.lastImageDates); + } } class _ImageGalleryLanguagesState { diff --git a/packages/smooth_app/lib/widgets/smooth_app_bar.dart b/packages/smooth_app/lib/widgets/smooth_app_bar.dart index 68a2d61157f..7c1829ddfaf 100644 --- a/packages/smooth_app/lib/widgets/smooth_app_bar.dart +++ b/packages/smooth_app/lib/widgets/smooth_app_bar.dart @@ -281,6 +281,8 @@ class _AppBarTitle extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ DefaultTextStyle( + maxLines: subTitle != null ? 1 : 2, + overflow: TextOverflow.ellipsis, style: (titleTextStyle ?? AppBarTheme.of(context).titleTextStyle ?? theme.appBarTheme.titleTextStyle?.copyWith(