fix: image_picker version

This commit is contained in:
mike doornenbal 2024-08-27 14:46:50 +02:00
parent 90a8ea6993
commit c2437fb3ce
3 changed files with 56 additions and 59 deletions

View file

@ -1,11 +1,10 @@
name: firebase_chat_repository name: firebase_chat_repository
description: "A new Flutter package project." description: "A new Flutter package project."
version: 0.0.1 version: 0.0.1
homepage: publish_to: "none"
publish_to: 'none'
environment: environment:
sdk: '>=3.4.3 <4.0.0' sdk: ">=3.4.3 <4.0.0"
flutter: ">=1.17.0" flutter: ">=1.17.0"
dependencies: dependencies:
@ -25,5 +24,3 @@ dev_dependencies:
git: git:
url: https://github.com/Iconica-Development/flutter_iconica_analysis url: https://github.com/Iconica-Development/flutter_iconica_analysis
ref: 7.0.0 ref: 7.0.0
flutter:

View file

@ -10,8 +10,9 @@ Future<void> onPressSelectImage(
BuildContext context, BuildContext context,
ChatOptions options, ChatOptions options,
Function(Uint8List image) onUploadImage, Function(Uint8List image) onUploadImage,
) async => ) async {
showModalBottomSheet<Uint8List?>( var theme = Theme.of(context);
return showModalBottomSheet<Uint8List?>(
context: context, context: context,
builder: (BuildContext context) => builder: (BuildContext context) =>
options.builders.imagePickerContainerBuilder?.call( options.builders.imagePickerContainerBuilder?.call(
@ -23,23 +24,25 @@ 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, titleStyle: theme.textTheme.titleMedium,
titleTextSize: 16, iconSize: 40,
titleAlignment: TextAlign.center, selectImageText: "UPLOAD FILE",
iconSize: 60.0, makePhotoText: "TAKE PICTURE",
makePhotoText: options.translations.takePicture,
selectImageText: options.translations.uploadFile,
selectImageIcon: const Icon( selectImageIcon: const Icon(
Icons.insert_drive_file_rounded, size: 40,
size: 60, Icons.insert_drive_file,
), ),
), closeButtonBuilder: (onTap) => TextButton(
customButton: TextButton( onPressed: () {
onPressed: () => Navigator.of(context).pop(), onTap();
},
child: Text( child: Text(
options.translations.cancelImagePickerBtn, "Cancel",
style: Theme.of(context).textTheme.bodyMedium, style: theme.textTheme.bodyMedium!.copyWith(
decoration: TextDecoration.underline,
),
),
), ),
), ),
), ),
@ -58,6 +61,7 @@ Future<void> onPressSelectImage(
}); });
}, },
); );
}
SnackBar _getImageLoadingSnackbar(ChatTranslations translations) => SnackBar( SnackBar _getImageLoadingSnackbar(ChatTranslations translations) => SnackBar(
duration: const Duration(minutes: 1), duration: const Duration(minutes: 1),

View file

@ -1,11 +1,10 @@
name: flutter_chat name: flutter_chat
description: "A new Flutter package project." description: "A new Flutter package project."
version: 0.0.1 version: 0.0.1
homepage: publish_to: "none"
publish_to: 'none'
environment: environment:
sdk: '>=3.4.3 <4.0.0' sdk: ">=3.4.3 <4.0.0"
flutter: ">=1.17.0" flutter: ">=1.17.0"
dependencies: dependencies:
@ -16,9 +15,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
@ -33,5 +31,3 @@ dev_dependencies:
git: git:
url: https://github.com/Iconica-Development/flutter_iconica_analysis url: https://github.com/Iconica-Development/flutter_iconica_analysis
ref: 7.0.0 ref: 7.0.0
flutter: