mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-19 10:53:51 +02:00
fix: image_picker version
This commit is contained in:
parent
90a8ea6993
commit
c2437fb3ce
3 changed files with 56 additions and 59 deletions
|
@ -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:
|
||||||
|
@ -14,7 +13,7 @@ dependencies:
|
||||||
|
|
||||||
chat_repository_interface:
|
chat_repository_interface:
|
||||||
path: ../chat_repository_interface
|
path: ../chat_repository_interface
|
||||||
|
|
||||||
firebase_storage: any
|
firebase_storage: any
|
||||||
cloud_firestore: any
|
cloud_firestore: any
|
||||||
|
|
||||||
|
@ -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:
|
|
|
@ -10,54 +10,58 @@ 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);
|
||||||
context: context,
|
return showModalBottomSheet<Uint8List?>(
|
||||||
builder: (BuildContext context) =>
|
context: context,
|
||||||
options.builders.imagePickerContainerBuilder?.call(
|
builder: (BuildContext context) =>
|
||||||
context,
|
options.builders.imagePickerContainerBuilder?.call(
|
||||||
() => Navigator.of(context).pop(),
|
context,
|
||||||
options.translations,
|
() => Navigator.of(context).pop(),
|
||||||
) ??
|
options.translations,
|
||||||
Container(
|
) ??
|
||||||
padding: const EdgeInsets.all(8.0),
|
Container(
|
||||||
color: Colors.white,
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: ImagePicker(
|
color: Colors.white,
|
||||||
imagePickerTheme: ImagePickerTheme(
|
child: ImagePicker(
|
||||||
title: options.translations.imagePickerTitle,
|
theme: ImagePickerTheme(
|
||||||
titleTextSize: 16,
|
titleStyle: theme.textTheme.titleMedium,
|
||||||
titleAlignment: TextAlign.center,
|
iconSize: 40,
|
||||||
iconSize: 60.0,
|
selectImageText: "UPLOAD FILE",
|
||||||
makePhotoText: options.translations.takePicture,
|
makePhotoText: "TAKE PICTURE",
|
||||||
selectImageText: options.translations.uploadFile,
|
selectImageIcon: const Icon(
|
||||||
selectImageIcon: const Icon(
|
size: 40,
|
||||||
Icons.insert_drive_file_rounded,
|
Icons.insert_drive_file,
|
||||||
size: 60,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
customButton: TextButton(
|
closeButtonBuilder: (onTap) => TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
onTap();
|
||||||
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
options.translations.cancelImagePickerBtn,
|
"Cancel",
|
||||||
style: Theme.of(context).textTheme.bodyMedium,
|
style: theme.textTheme.bodyMedium!.copyWith(
|
||||||
|
decoration: TextDecoration.underline,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
).then(
|
),
|
||||||
(image) async {
|
).then(
|
||||||
if (image == null) return;
|
(image) async {
|
||||||
var messenger = ScaffoldMessenger.of(context)
|
if (image == null) return;
|
||||||
..showSnackBar(
|
var messenger = ScaffoldMessenger.of(context)
|
||||||
_getImageLoadingSnackbar(options.translations),
|
..showSnackBar(
|
||||||
)
|
_getImageLoadingSnackbar(options.translations),
|
||||||
..activate();
|
)
|
||||||
await onUploadImage(image);
|
..activate();
|
||||||
Future.delayed(const Duration(seconds: 1), () {
|
await onUploadImage(image);
|
||||||
messenger.hideCurrentSnackBar();
|
Future.delayed(const Duration(seconds: 1), () {
|
||||||
});
|
messenger.hideCurrentSnackBar();
|
||||||
},
|
});
|
||||||
);
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
SnackBar _getImageLoadingSnackbar(ChatTranslations translations) => SnackBar(
|
SnackBar _getImageLoadingSnackbar(ChatTranslations translations) => SnackBar(
|
||||||
duration: const Duration(minutes: 1),
|
duration: const Duration(minutes: 1),
|
||||||
|
|
|
@ -1,29 +1,27 @@
|
||||||
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:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
cached_network_image: ^3.2.2
|
cached_network_image: ^3.2.2
|
||||||
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
|
||||||
url: https://github.com/Iconica-Development/flutter_profile
|
url: https://github.com/Iconica-Development/flutter_profile
|
||||||
chat_repository_interface:
|
chat_repository_interface:
|
||||||
path: ../chat_repository_interface
|
path: ../chat_repository_interface
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
@ -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:
|
|
||||||
|
|
Loading…
Reference in a new issue