saveImage method

Future<AssetEntity> saveImage(
  1. Uint8List data, {
  2. required String filename,
  3. String? title,
  4. String? desc,
  5. String? relativePath,
  6. int? orientation,
  7. double? latitude,
  8. double? longitude,
  9. DateTime? creationDate,
})

Implementation

Future<AssetEntity> saveImage(
  typed_data.Uint8List data, {
  required String filename,
  String? title,
  String? desc,
  String? relativePath,
  int? orientation,
  double? latitude,
  double? longitude,
  DateTime? creationDate,
}) 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,
      'latitude': latitude,
      'longitude': longitude,
      'creationDate': creationDate?.millisecondsSinceEpoch,
      ...onlyAddPermission,
    },
  );
  return ConvertUtils.convertMapToAsset(result.cast(), title: filename);
}