mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 13:05:11 +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 {
|
void sendFileAction() async {
|
||||||
final result = await AppLock.of(context).pauseWhile(
|
final result = await AppLock.of(context).pauseWhile(
|
||||||
FilePicker.platform.pickFiles(
|
FilePicker.platform.pickFiles(
|
||||||
allowMultiple: true,
|
allowMultiple: false,
|
||||||
withData: true,
|
withData: true,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -524,12 +524,11 @@ class ChatController extends State<ChatPageWithRoom> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendImageAction() async {
|
void sendImageAction() async {
|
||||||
//AppLock.of(context).pauseWhile();
|
|
||||||
final result = await AppLock.of(context).pauseWhile(
|
final result = await AppLock.of(context).pauseWhile(
|
||||||
FilePicker.platform.pickFiles(
|
FilePicker.platform.pickFiles(
|
||||||
type: FileType.image,
|
type: FileType.image,
|
||||||
withData: true,
|
withData: true,
|
||||||
allowMultiple: true,
|
allowMultiple: false,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (result == null || result.files.isEmpty) return;
|
if (result == null || result.files.isEmpty) return;
|
||||||
|
@ -575,7 +574,10 @@ class ChatController extends State<ChatPageWithRoom> {
|
||||||
void openVideoCameraAction() async {
|
void openVideoCameraAction() async {
|
||||||
// Make sure the textfield is unfocused before opening the camera
|
// Make sure the textfield is unfocused before opening the camera
|
||||||
FocusScope.of(context).requestFocus(FocusNode());
|
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;
|
if (file == null) return;
|
||||||
final bytes = await file.readAsBytes();
|
final bytes = await file.readAsBytes();
|
||||||
await showDialog(
|
await showDialog(
|
||||||
|
|
Loading…
Reference in a new issue