flutter_animated 0.0.4

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 24

flutter_animated

Animated images (GIF/APNG/WebP) support in flutter.

The plugin is under construction.

It lacks of basic features, and has got a number of serious issues.

USAGE

require it

in pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
  flutter_animated: any

basic usage

// import
import 'flutter_animated/animated_gif.dart';

// fetch a gif
final Uint8List imgBytes = await http.readBytes('https://some.site/some.gif');

// generate a Widget for the gif
final Widget gifWidget = new AnimatedGif.memory(imgBytes);

NOTES

Currently the only format being supported is gif and the only constructor is .memory.

AnimatedGif inherits from Image and StatefulWidget. This may change in the future though.

The performance is way not ideal for now. The good news is, it shows the first frame while decoding.

TODO

[0.0.1] - 2017 Jun 5.

Added

  • provided a simple AnimatedGif class

[0.0.2] - 2017 Jun 13.

Fixed

  • avoid freezing via an isolate

[0.0.3] - 2017 Jun 14.

Changed

  • change default constructor to named constrctor .memory

[0.0.4] - 2017 Jun 20.

  • minor improvements.

example/lib/main.dart

// UNDER CONSTRUCTION

// import 'package:flutter/material.dart';
// import 'package:flutter/services.dart';
// import 'package:flutter_animated/flutter_animated.dart';

// void main() {
//   runApp(new MyApp());
// }

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

// class _MyAppState extends State<MyApp> {
//   String _platformVersion = 'Unknown';

//   @override
//   initState() {
//     super.initState();
//     initPlatformState();
//   }

//   // Platform messages are asynchronous, so we initialize in an async method.
//   initPlatformState() async {
//     String platformVersion;
//     // Platform messages may fail, so we use a try/catch PlatformException.
//     try {
//       platformVersion = await FlutterAnimated.platformVersion;
//     } on PlatformException {
//       platformVersion = 'Failed to get platform version.';
//     }

//     // If the widget was removed from the tree while the asynchronous platform
//     // message was in flight, we want to discard the reply rather than calling
//     // setState to update our non-existent appearance.
//     if (!mounted)
//       return;

//     setState(() {
//       _platformVersion = platformVersion;
//     });
//   }

//   @override
//   Widget build(BuildContext context) {
//     return new MaterialApp(
//       home: new Scaffold(
//         appBar: new AppBar(
//           title: new Text('Plugin example app'),
//         ),
//         body: new Center(
//           child: new Text('Running on: $_platformVersion\n'),
//         ),
//       ),
//     );
//   }
// }

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_animated: ^0.0.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_animated/animated_gif.dart';
import 'package:flutter_animated/gif_parser.dart';
  
Version Uploaded Documentation Archive
0.0.4 Jun 20, 2017 Go to the documentation of flutter_animated 0.0.4 Download flutter_animated 0.0.4 archive
0.0.3 Jun 14, 2017 Go to the documentation of flutter_animated 0.0.3 Download flutter_animated 0.0.3 archive
0.0.2 Jun 13, 2017 Go to the documentation of flutter_animated 0.0.2 Download flutter_animated 0.0.2 archive
0.0.1 Jun 12, 2017 Go to the documentation of flutter_animated 0.0.1 Download flutter_animated 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
48
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
24
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Maintenance issues and suggestions

Add SDK constraint in pubspec.yaml. (-50 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: image.

Package is getting outdated. (-40.27 points)

The package was released 73 weeks ago.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
flutter 0.0.0
image any 2.0.4
Transitive dependencies
archive 2.0.4
args 1.5.1
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
meta 1.1.6
path 1.6.2
petitparser 2.0.2
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
xml 3.2.3