saveImage method

Future<AssetEntity> saveImage(
  1. Uint8List data, {
  2. required String filename,
  3. String? title,
  4. String? desc,
  5. String? relativePath,
  6. int? orientation,
})

Implementation

Future<AssetEntity> saveImage(
  typed_data.Uint8List data, {
  required String filename,
  String? title,
  String? desc,
  String? relativePath,
  int? orientation,
}) async {
  _throwIfOrientationInvalid(orientation);
  final Map result = await _channel.invokeMethod(
    PMConstants.mSaveImage,
    <String, dynamic>{
      'image': data,
      'filename': filename,
      'title': title,
      'desc': desc,
      'relativePath': relativePath,
      'orientation': orientation,
      ...onlyAddPermission,
    },
  );
  return ConvertUtils.convertMapToAsset(result.cast(), title: filename);
}