media_utils 1.0.3

MediaUtils #

An easy helper class to flutter with many support formats. Suport local and web files.

We often need to identify the format of a file to know if we will display a video player for video, an image for an image file, etc. This plugin does it easily and conveniently. if (MediaUtils.isVideo (your_path)) {    // do anything } Supports local and web files, and image, video, word, pdf, apk, excel, and txt formats

example:

if (MediaUtils.isAudio(_path)) {
  // ToDo anything
}
if (MediaUtils.isVideo(_path)) {
  // ToDo anything
}
if (MediaUtils.isImage(_path)) {
  // ToDo anything
}
if (MediaUtils.isVideo(_path)) {
  // ToDo anything
}
if (MediaUtils.isApk(_path)) {
  // ToDo anything
}
if (MediaUtils.isPDF(_path)) {
  // ToDo anything
}

if (MediaUtils.isWord(_path)) {
  // ToDo anything
}
if (MediaUtils.isTxt(_path)) {
  // ToDo anything
}

1.0.0 #

  • Initial release from MediaUtils

1.0.1 #

  • Fix repo data

1.0.2 #

  • Fix broken links

1.0.2 #

  • Fix bugs

example/readme.md

MediaUtils #

An easy helper class to flutter with many support formats. Suport local and web files.

example:

if (MediaUtils.isAudio(_path)) {
  // ToDo anything
}
if (MediaUtils.isVideo(_path)) {
  // ToDo anything
}
if (MediaUtils.isImage(_path)) {
  // ToDo anything
}
if (MediaUtils.isVideo(_path)) {
  // ToDo anything
}
if (MediaUtils.isApk(_path)) {
  // ToDo anything
}
if (MediaUtils.isPDF(_path)) {
  // ToDo anything
}

if (MediaUtils.isWord(_path)) {
  // ToDo anything
}
if (MediaUtils.isTxt(_path)) {
  // ToDo anything
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  media_utils: ^1.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:media_utils/media_utils.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Sep 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

13 out of 13 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/media_utils.dart.

Run flutter format to format lib/media_utils.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test