simple_animations 1.3.11

  • Readme
  • Changelog
  • Example
  • Installing
  • 99

Simple Animations #

Awesome Flutter Pub

Simple Animations is a package for Flutter to boost your animation productivity by simplifying the way to create animations.

Project goal #

Flutter has a strong and flexible foundation of animation capabilities.

But even small animations feel verbose and blow up your code base. Animations are one of the most desired aspects of Flutter, while being difficult to master.

Simple Animation's goal is to solve this issue, by

  • simplifying the way to creates custom animations,
  • softly dipping developers into the animation topic,
  • offering a lot of documentation and examples.

Getting started #

There are multiple ways to get started:

Examples #

Typewriter Box #

This custom animation seems simple but it's rather complex:

hello-flutter-example

It's combining a staggered animation sequence with an enduring animation:

  • At the beginning it animates the height of a box. After that it increases the width.
  • While increasing the width a typewriter-like animated underscore appears and persists.
  • Shortly before the width reaches it's final size, it starts to type-write a text.

With traditional Flutter animation classes this will end in a huge StatefulWidget with multiple AnimationController, Tweens and all that initState and onDispose overhead.

With simple_animation you can do it stateless just by using some fancy ControlledAnimation widgets.

The whole animation just takes about 60 lines of code while maintaining readability. (You can find the source code here. I only counted the lines that are responsible for the animation.)

Example App #

You find these and other examples in the Example App.

fancy-background

rectangle

fade-in

1.3.11 #

  • Integrated example from pub example page into example_app

1.3.10 #

  • App example is now fully integrated into package example
  • Updated all documentation references to the app example

1.3.9 #

  • Fixed Flutter health suggestions
  • Updated links to example app

1.3.8 #

  • Integrated app example into main repository:
    • example/example_app

1.3.7 #

  • This release contains fixes requested by the Flutter Ecosystem Committee:
    • Added API documentation and improved test coverage
    • Accidentally public method LoopTask.finishIteration(Duration) is now private. Instead you can use public APIs of AnimationControllerX to control the tasks.
    • Accidentally public method AnimationControllerX.completeCurrentTask() is now private. Instead you can use AnimationControllerX.forceCompleteCurrentTask().

1.3.6 #

  • Fixed bug in type generics

1.3.5 #

  • Preparations for avoiding implicit casting

1.3.4 #

  • Fixed documentation: missing line about manual creation of AnimationControllerX

1.3.1 - 1.3.3 #

  • Upgraded to Flutter 1.7 and Dart 2.4

1.3.0 #

  • Upgraded to Flutter 1.5 and Dart 2.3

New features #

  • AnimationControllerX a new, powerful AnimationController
  • AnimationControllerMixin to easily setup AnimationControllerX
  • 5 types of AnimationTasks to use for AnimationControllerX

1.2.0 #

New features #

  • Rendering a widget for building of continuous animations
  • AnimationProgress a utility class that helps you with Duration-based Animations

1.1.1 #

  • Fixed strange effect when rebuilding a ControlledAnimation with playback set to Playback.MIRROR

1.1.0 #

New features #

  • New property startPosition for ControlledAnimation widget: you can now specify the initial start position (time) of the animation. This is useful for designing interactive UI elements.

1.0.0 #

  • Initial release

New features #

  • ControlledAnimation: Widget for simple tween-based custom animations
  • MultiTrackTween: Animatable for tweening multiple properties at once

0.x #

  • Setting up the project

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:simple_animations_example_app/widgets/homescreen.dart';

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

class SimpleAnimationsExampleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: "Simple Animations Example App",
      home: Homescreen(),
      theme: _theme(),
    );
  }

  ThemeData _theme() {
    var lightTheme = ThemeData.light();

    return lightTheme.copyWith(
        textTheme: lightTheme.textTheme.copyWith(
            body1: lightTheme.textTheme.body1.copyWith(height: 1.25),
            body2: lightTheme.textTheme.body2
                .copyWith(height: 1.25, fontWeight: FontWeight.w800)),
        appBarTheme: AppBarTheme(color: Color.fromARGB(255, 30, 30, 30)));
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  simple_animations: ^1.3.11

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

We analyzed this package on Apr 3, 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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.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
Dev dependencies
flutter_test