getMimeTypeAsync method

Future<String?> getMimeTypeAsync(
  1. AssetEntity entity
)

Implementation

Future<String?> getMimeTypeAsync(AssetEntity entity) async {
  assert(
    Platform.isAndroid ||
        Platform.isIOS ||
        Platform.isMacOS ||
        PlatformUtils.isOhos,
  );
  if (Platform.isAndroid || PlatformUtils.isOhos) {
    return entity.mimeType;
  }
  if (Platform.isIOS || Platform.isMacOS) {
    return _channel.invokeMethod<String>(
      PMConstants.mGetMimeTypeAsync,
      <String, dynamic>{'id': entity.id},
    );
  }
  return null;
}