flutter_mime 0.0.2 copy "flutter_mime: ^0.0.2" to clipboard
flutter_mime: ^0.0.2 copied to clipboard

Mime Types for Flutter

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])
}
0
likes
120
points
57
downloads

Publisher

unverified uploader

Weekly Downloads

Mime Types for Flutter

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, freezed_annotation, json_serializable

More

Packages that depend on flutter_mime