getImagesFromCamera method

Future<List<Uint8List>?> getImagesFromCamera()

Implementation

Future<List<Uint8List>?> getImagesFromCamera() async {
  XFile? pickedFile =
      await ModernFormImageHelper.pickImage(ImageSource.camera);

  if (pickedFile != null && onChanged != null) {
    Uint8List bytes = await pickedFile.readAsBytes();

    List<Uint8List> _i = List<Uint8List>.from(images ?? []);
    _i.add(bytes);

    return _i;
  } else {
    return null;
  }
}