flutter_lottie_4basic 0.8.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 82

flutter_lottie_4basic #

Use Lottie in Flutter.

Supports both iOS and Android using lottie-ios and lottie-android

Current Status #

Supports most features that both iOS and Android support.

The only dynamic property changing that is supported for now is color and opacity. Project will be updated later to include support for other properties.

Example in the github repo includes a good intro into using the library.

IMPORTANT NOTE #

To use with iOS, you will need to add this key to your info.plist file located in: project/ios/Runner/Info.plist

<key>io.flutter.embedded_views_preview</key>
<true />

Notes #

This repo is forked from mark922/flutter_lottie and add some basic feature on it

0.0.1 #

fork from other's project

0.1.0 #

add animation content size scale type for android and ios platform

0.2.0 #

upgrade for uploading package to dart.dev

0.3.0 #

add image content scale type for ios and android

0.8.0 #

  1. Upgrade Android lottie lib to 3.3.1
  2. Remove Lottie playback speed limit

0.8.2 #

  1. change ios lottie version to specific version '3.1.6'

0.8.3 #

  1. update ios lottie lib to v3.1.8
  2. update android lottie lib to v3.4.1

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {
  LottieController controller2;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Lottie'),
        ),
        body: Center(
          child: Container(
            width: 150,
            height: 150,
            child: LottieView.fromFile(
              filePath: "animations/newAnimation.json",
              autoPlay: true,
              loop: true,
              reverse: true,
              onViewCreated: onViewCreatedFile,
            ),
          ),
        ),
      ),
    );
  }

  void onViewCreatedFile(LottieController controller) {
    this.controller2 = controller;
  }

  void dispose() {
    super.dispose();
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_lottie_4basic: ^0.8.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:flutter_lottie_4basic/flutter_lottie_4basic.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
65
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]
82
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:flutter_lottie_4basic/flutter_lottie_4basic.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:flutter_lottie_4basic/flutter_lottie_4basic.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:flutter_lottie_4basic/flutter_lottie_4basic.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:flutter_lottie_4basic/flutter_lottie_4basic.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • flutter_lottie_4basic that is a package requiring null.

Health issues and suggestions

Document public APIs. (-0.39 points)

47 out of 48 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.

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

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

line 9 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: LottieView.url, LottieView.filePath

Format lib/src/lottie_controller.dart.

Run flutter format to format lib/src/lottie_controller.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.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test