imageDownloadFromCamera method

  1. @override
Future<Map<String, dynamic>> imageDownloadFromCamera(
  1. int position
)
override

Implementation

@override
Future<Map<String, dynamic>> imageDownloadFromCamera(position) async {
  // if (isRequestPending) {
  //   return {
  //     "isError": true,
  //     "message": "PENDING_PREVIOUS_REQUEST",
  //     "details": "Called imageDownloadFromCamera()"
  //   };
  // }
  if (initializedCamera.isEmpty) {
    return {"isError": true, "message": "Invalid camera operation!"};
  }
  // isRequestPending = true;

  List dataList = await methodChannel
      .invokeMethod('IMAGE_SAVE_LOCAL', {"position": position});

  // isRequestPending = false;
  return {
    "isError": false,
    "dataList": dataList,
    "message": "Saved to your local device"
  };
}