-
-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 3772 - access to nutrion photo from nutrition page (#3851)
* feat: 3772 - access to nutrion photo from nutrition page New file: * `product_image_unswipeable_view.dart`: Display of the photo of a product image field. Impacted files: * `nutrition_page_loaded.dart`: added a "go to picture" button * `product_image_swipeable_view.dart`: minor refactoring * feat: 3772 - new view as a stateless widget Impacted file: * `product_image_unswipeable_view.dart`: now as a stateless widget.
- Loading branch information
1 parent
54560ff
commit d5a4d27
Showing
3 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/smooth_app/lib/pages/product/product_image_unswipeable_view.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
import 'package:openfoodfacts/openfoodfacts.dart'; | ||
import 'package:smooth_app/generic_lib/design_constants.dart'; | ||
import 'package:smooth_app/generic_lib/widgets/smooth_back_button.dart'; | ||
import 'package:smooth_app/helpers/product_cards_helper.dart'; | ||
import 'package:smooth_app/pages/product/product_image_viewer.dart'; | ||
import 'package:smooth_app/widgets/smooth_scaffold.dart'; | ||
|
||
/// Display of the photo of a product image field. | ||
/// | ||
/// See also [ProductImageSwipeableView]. | ||
class ProductImageUnswipeableView extends StatelessWidget { | ||
const ProductImageUnswipeableView({ | ||
super.key, | ||
required this.product, | ||
required this.imageField, | ||
}); | ||
|
||
final Product product; | ||
final ImageField imageField; | ||
|
||
@override | ||
Widget build(BuildContext context) => SmoothScaffold( | ||
appBar: AppBar( | ||
backgroundColor: Colors.black, | ||
foregroundColor: WHITE_COLOR, | ||
elevation: 0, | ||
title: Text( | ||
getImagePageTitle(AppLocalizations.of(context), imageField), | ||
maxLines: 2, | ||
), | ||
leading: SmoothBackButton( | ||
iconColor: Colors.white, | ||
onPressed: () => Navigator.maybePop(context), | ||
), | ||
), | ||
body: ProductImageViewer( | ||
product: product, | ||
imageField: imageField, | ||
), | ||
); | ||
} |