pickVideoFromCamera method

Future<void> pickVideoFromCamera()

Opens the camera app and adds the captured video to the attachments.

Implementation

Future<void> pickVideoFromCamera() async {
  field.focus.unfocus();

  // TODO: Remove the limitations when bigger files are supported on backend.
  final XFile? video = await ImagePicker().pickVideo(
    source: ImageSource.camera,
    maxDuration: const Duration(seconds: 15),
  );

  if (video != null) {
    _addXFileAttachment(video);
  }
}