Mime Types for Flutter
Features
- Get Mime Type from Extension
- Get Extension Name from Mime Type
Getting started
- For Dart
dart pub add flutter_mime
- For Flutter
flutter pub add flutter_mime
Usage
import 'package:flutter_mime/flutter_mime.dart';
void main(List<String> args) {
print(FlutterMime.getExtensionFromType('application/pdf'));
// returns `pdf`
print(FlutterMime.getTypeFromExtension('pdf'));
// returns `application/pdf`
print(FlutterMime.getMime('application/pdf'));
// returns Mime(charset: null, source: iana, compressible: false, extensions: [pdf])
}