added clear message for denied camera or gallery access
This commit is contained in:
@@ -38,7 +38,7 @@ void showAddFileSheet(
|
||||
leading: const Icon(Icons.add_a_photo_outlined),
|
||||
title: const Text('Aus Galerie hochladen'),
|
||||
onTap: () {
|
||||
FilePick.multipleGalleryPick().then((value) {
|
||||
FilePick.multipleGalleryPick(context).then((value) {
|
||||
if (value != null) onPickedFiles(value.map((e) => e.path).toList());
|
||||
});
|
||||
Navigator.of(sheetCtx).pop();
|
||||
@@ -48,7 +48,7 @@ void showAddFileSheet(
|
||||
leading: const Icon(Icons.camera_alt_outlined),
|
||||
title: const Text('Foto aufnehmen'),
|
||||
onTap: () {
|
||||
FilePick.cameraPick().then((image) {
|
||||
FilePick.cameraPick(context).then((image) {
|
||||
if (image != null) onPickedFiles([image.path]);
|
||||
});
|
||||
Navigator.of(sheetCtx).pop();
|
||||
|
||||
@@ -43,7 +43,7 @@ class _FeedbackDialogState extends State<FeedbackDialog> {
|
||||
}
|
||||
|
||||
Future<void> _pickImage() async {
|
||||
final picked = await FilePick.singleGalleryPick();
|
||||
final picked = await FilePick.singleGalleryPick(context);
|
||||
if (picked == null) return;
|
||||
final data = await picked.readAsBytes();
|
||||
if (!mounted) return;
|
||||
|
||||
@@ -164,7 +164,7 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
leading: const Icon(Icons.image),
|
||||
title: const Text('Aus Galerie auswählen'),
|
||||
onTap: () {
|
||||
FilePick.multipleGalleryPick().then((value) {
|
||||
FilePick.multipleGalleryPick(context).then((value) {
|
||||
if (value != null) {
|
||||
mediaUpload(value.map((e) => e.path).toList());
|
||||
}
|
||||
@@ -176,7 +176,7 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
leading: const Icon(Icons.camera_alt_outlined),
|
||||
title: const Text('Foto aufnehmen'),
|
||||
onTap: () {
|
||||
FilePick.cameraPick().then((image) {
|
||||
FilePick.cameraPick(context).then((image) {
|
||||
if (image != null) mediaUpload([image.path]);
|
||||
});
|
||||
Navigator.of(sheetCtx).pop();
|
||||
|
||||
Reference in New Issue
Block a user