thumbnaillib 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 42

thumbnaillib #

flutter 获取视频缩略的控件

@override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ThumbnailImage(
            videoUrl: "https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4",//视频的地址
            showWidth: 100,//图片目标宽高
            showHeight: 200,//图片目标宽高
            imageType: ImageType.CENTER_INSIDE,//图片的缩放方式
          ),
        ),
      ),
    );
  }

0.1.1 #

  • 支持获取缩略图

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:thumbnaillib/thumbnaillib.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }



  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ThumbnailImage(
            videoUrl: "https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4",
            showWidth: 100,
            showHeight: 200,
            imageType: ImageType.CENTER_INSIDE,
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  thumbnaillib: ^0.1.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:thumbnaillib/thumbnaillib.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]
60
Overall:
Weighted score of the above. [more]
42
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:thumbnaillib/thumbnaillib.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:thumbnaillib/thumbnaillib.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:thumbnaillib/thumbnaillib.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:thumbnaillib/thumbnaillib.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [thumbnaillib] that is in a package requiring null.

Health suggestions

Fix lib/src/thumbnail_channel.dart. (-0.50 points)

Analysis of lib/src/thumbnail_channel.dart reported 1 hint:

line 7 col 30: The value of the field '_channel' isn't used.

Fix lib/src/thumbnail_image.dart. (-0.50 points)

Analysis of lib/src/thumbnail_image.dart reported 1 hint:

line 11 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: ThumbnailImage.showWidth, ThumbnailImage.showHeight

Format lib/thumbnaillib.dart.

Run flutter format to format lib/thumbnaillib.dart.

Maintenance issues and suggestions

The description contains too many non-ASCII characters. (-20 points)

The site uses English as its primary language. The value of the description field in your package's pubspec.yaml field should primarily contain characters used in English.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

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