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

The Flutter package os_mime_type enables the conversion of mime types to file extensions and vice versa, facilitating seamless interaction with file types in application development.

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
140
points
1.49k
downloads

Publisher

unverified uploader

Weekly Downloads

The Flutter package os_mime_type enables the conversion of mime types to file extensions and vice versa, facilitating seamless interaction with file types in application development.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, path

More

Packages that depend on os_mime_type