showPhotoBanner function
Implementation
Future<File?> showPhotoBanner({
required BuildContext context,
required Product product,
required ImageField imageField,
required OpenFoodFactsLanguage language,
TransientFile? transientFile,
}) async {
final PhotoRowActions? action = await _showPhotoBanner(
context: context,
product: product,
imageField: imageField,
language: language,
transientFile: transientFile,
);
if (!context.mounted || action == null) {
return null;
}
return switch (action) {
PhotoRowActions.takePicture => _takePicture(
context: context,
product: product,
imageField: imageField,
language: language,
pictureSource: UserPictureSource.CAMERA,
),
PhotoRowActions.selectFromGallery => _takePicture(
context: context,
product: product,
imageField: imageField,
language: language,
pictureSource: UserPictureSource.GALLERY,
),
PhotoRowActions.selectFromProductPhotos => _selectPictureFromProductGallery(
context: context,
product: product,
imageField: imageField,
language: language,
),
};
}