fix: upgrade image_picker to 4.0.0

This commit is contained in:
mike doornenbal 2024-08-07 13:50:39 +02:00 committed by Freek van de Ven
parent f8bffceb4b
commit ed95dbd15c
2 changed files with 14 additions and 12 deletions

View file

@ -23,10 +23,9 @@ Future<void> onPressSelectImage(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
color: Colors.white, color: Colors.white,
child: ImagePicker( child: ImagePicker(
imagePickerTheme: ImagePickerTheme( theme: ImagePickerTheme(
title: options.translations.imagePickerTitle, title: options.translations.imagePickerTitle,
titleTextSize: 16, titleStyle: Theme.of(context).textTheme.titleMedium,
titleAlignment: TextAlign.center,
iconSize: 60.0, iconSize: 60.0,
makePhotoText: options.translations.takePicture, makePhotoText: options.translations.takePicture,
selectImageText: options.translations.uploadFile, selectImageText: options.translations.uploadFile,
@ -34,12 +33,15 @@ Future<void> onPressSelectImage(
Icons.insert_drive_file_rounded, Icons.insert_drive_file_rounded,
size: 60, size: 60,
), ),
), closeButtonBuilder: (ontap) => TextButton(
customButton: TextButton(
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
child: Text( child: Text(
options.translations.cancelImagePickerBtn, options.translations.cancelImagePickerBtn,
style: Theme.of(context).textTheme.bodyMedium, style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 18,
decoration: TextDecoration.underline,
),
),
), ),
), ),
), ),
@ -47,6 +49,7 @@ Future<void> onPressSelectImage(
).then( ).then(
(image) async { (image) async {
if (image == null) return; if (image == null) return;
if (!context.mounted) return;
var messenger = ScaffoldMessenger.of(context) var messenger = ScaffoldMessenger.of(context)
..showSnackBar( ..showSnackBar(
_getImageLoadingSnackbar(options.translations), _getImageLoadingSnackbar(options.translations),

View file

@ -16,9 +16,8 @@ dependencies:
intl: any intl: any
flutter_image_picker: flutter_image_picker:
git: hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub
url: https://github.com/Iconica-Development/flutter_image_picker version: ^4.0.0
ref: 1.0.5
flutter_profile: flutter_profile:
git: git:
ref: 1.6.0 ref: 1.6.0