os_mime_type 0.0.1 copy "os_mime_type: ^0.0.1" to clipboard
os_mime_type: ^0.0.1 copied to clipboard

Convert Mime Type to Extension or Extension Format to Mime

example/main.dart

import 'package:flutter/material.dart';
import 'package:os_mime_type/os_mime_type.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'OS Mime Type Demo',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('OS Mime Type Demo'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'Mime Type from Extension: ${mimeFromExtension(extension: ".png")}',
              ),
              Text(
                'Mime Type from File Name: ${mimeFromFileName(fileName: "image.jpg")}',
              ),
              Text(
                'Extension from Mime: ${extensionFromMime(mime: "application/json")}',
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
130
points
1.49k
downloads

Publisher

unverified uploader

Weekly Downloads

Convert Mime Type to Extension or Extension Format to Mime

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, path

More

Packages that depend on os_mime_type