chore: Limit image file and video picker until we have a background service

This commit is contained in:
krille-chan 2023-10-28 11:47:31 +02:00
parent 94fc250751
commit a327e8b0e9
No known key found for this signature in database

View file

@ -485,7 +485,7 @@ class ChatController extends State<ChatPageWithRoom> {
void sendFileAction() async {
final result = await AppLock.of(context).pauseWhile(
FilePicker.platform.pickFiles(
allowMultiple: true,
allowMultiple: false,
withData: true,
),
);
@ -524,12 +524,11 @@ class ChatController extends State<ChatPageWithRoom> {
}
void sendImageAction() async {
//AppLock.of(context).pauseWhile();
final result = await AppLock.of(context).pauseWhile(
FilePicker.platform.pickFiles(
type: FileType.image,
withData: true,
allowMultiple: true,
allowMultiple: false,
),
);
if (result == null || result.files.isEmpty) return;
@ -575,7 +574,10 @@ class ChatController extends State<ChatPageWithRoom> {
void openVideoCameraAction() async {
// Make sure the textfield is unfocused before opening the camera
FocusScope.of(context).requestFocus(FocusNode());
final file = await ImagePicker().pickVideo(source: ImageSource.camera);
final file = await ImagePicker().pickVideo(
source: ImageSource.camera,
maxDuration: const Duration(minutes: 1),
);
if (file == null) return;
final bytes = await file.readAsBytes();
await showDialog(