thumbnails 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 87

thumbnails #

A Flutter Plugin to generate thumbnails from videos on Local Storage.

Compatibility #

Android OS only

Usage #

Depend on it

add thumbnails as a dependency in your pubspec.yaml file.

        thumbnails: ^1.0.1

Update Android Permissions

add the lines to AndroidManifest.xml

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

NOTE: for android versions >= 6.0 you need might to request Permission from user at runtime before calling this plugin. (There are available plugins that handles permissions on DartLang.)

Add import statement

Import the library

    import 'package:thumbnails/thumbnails.dart';


    String thumb = await Thumbnails.getThumbnail(
        thumbnailFolder:'[FOLDER PATH TO STORE THUMBNAILS]', // creates the specified path if it doesnt exist
        videoFile: '[VIDEO PATH HERE]',
        imageType: ThumbFormat.PNG,
        quality: 30);

    * thumbnailFolder property can be omitted if you dont wish to keep the generated thumbails past each usage

1.0.1 - 2018-11-15 #

  • Updated Plugin description to better explain it's usage
  • Minor changes

1.0.0 - 2018-11-15 #

  • Initial release


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

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  // Fetch thumbnail and store in a specified output folder
  void _toUserFolder() async {
    String thumb = await Thumbnails.getThumbnail(
        thumbnailFolder: '/storage/emulated/0/Videos/Thumbnails',
        videoFile: '/storage/emulated/0/Videos/Testvideo.mp4',
        imageType: ThumbFormat.PNG,
        quality: 30);
    print('path to File: $thumb');

// when an output folder is not specified thumbnail are stored in app temporary directory
  void _noFolder() async {
    String thumb = await Thumbnails.getThumbnail(
        videoFile: '/storage/emulated/0/Videos/Testvideo.mp4',
        imageType: ThumbFormat.JPEG,
        quality: 30);
    print('Path to cache folder $thumb');

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        body: new Center(
          child: Column(
            children: <Widget>[
                  onPressed: _toUserFolder, child: Text('To Specified Folder')),
                  onPressed: _noFolder, child: Text('No Folder Specified')),

Use this package as a library

1. Depend on it

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

  thumbnails: ^1.0.1

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:thumbnails/thumbnails.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 1, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health issues and suggestions

Document public APIs. (-1 points)

14 out of 14 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.

Maintenance suggestions

Package is getting outdated. (-37.53 points)

The package was last published 71 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8