nameFromMimeType static method

  1. @visibleForTesting
String nameFromMimeType(
  1. String mimeType
)

Gets the name for a MIME type.

Implementation

@visibleForTesting
static String nameFromMimeType(String mimeType) {
  final String ext = extensionFromMimeType(mimeType) ?? 'bin';
  return mimeType.startsWith('image/') ? 'image.$ext' : 'file.$ext';
}