mirror of
https://github.com/krille-chan/fluffychat
synced 2024-08-11 11:53:50 +00:00
chore: Limit image file and video picker until we have a background service
This commit is contained in:
parent
94fc250751
commit
a327e8b0e9
1 changed files with 6 additions and 4 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue