anim

Fluent Flutter Animation library. Describe Sequences & Parallel animation's workflow, setup startDelay, duration and curve, then run !

Describe the Anim

Anim contains 3 major classes : AnimValues, AnimSequentially and AnimTogether.

Animation

AnimValues(
    name:"animationName", 
    values: [value0, value1, value2, ...],
    duration: Duration(seconds: 1),
);

Animation schedulers

AnimSequentially() to play one after the other animations AnimTogether() to play in parallel animations

AnimSequentially(anims: [
    anim1, anim2, anim3
]);
AnimTogether(anims: [
    anim1, anim2, anim3
]);

Example

sample1

this.anim = Anim(
        vsync: this,
        listener: () {
          setState(() {
            /* rebuild */
          });
        },
        /* Define initial values, used when the animation has not been launched */
        initiaValues: {
          "alpha": 1,
          "size": 100,
        },
        animations: [
          AnimSequentially(
              startDelay: const Duration(milliseconds: 400),
              anims: [

                //Animate the alpha, then the size
                AnimValues(
                  name: "alpha",
                  curve: Curves.easeIn,
                  duration: const Duration(milliseconds: 800),
                  values: [1, 0.4, 0.8, 0.5],
                ),
                AnimValues(
                  name: "size",
                  curve: Curves.easeIn,
                  duration: const Duration(milliseconds: 800),
                  values: [100, 140, 80],
                ),

                //and finally animate those two values together
                AnimTogether(anims: [
                  AnimValues(
                    name: "alpha",
                    curve: Curves.easeIn,
                    duration: const Duration(milliseconds: 800),
                    values: [0.5, 1],
                  ),
                  AnimValues(
                    name: "size",
                    curve: Curves.easeIn,
                    duration: const Duration(milliseconds: 800),
                    values: [80, 100],
                  ),
                ])
              ]),
        ]);

Bind your Anim

@override
Widget build(BuildContext context) {
  return Opacity(
      opacity: this.anim["alpha"],
      child: SizedBox(
          height: this.anim["size"],
          width: this.anim["size"]
          child: _yourView(),
      ),
    );
  }
}

Getting Started

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Libraries

anim
animatable
animation

Dart

dart:ui
Built-in types and core primitives for a Flutter application. [...]

Core

dart:async
Support for asynchronous programming, with classes such as Future and Stream. [...]
dart:collection
Classes and utilities that supplement the collection support in dart:core. [...]
dart:convert
Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
dart:core
Built-in types, collections, and other core functionality for every Dart program. [...]
dart:developer
Interact with developer tools such as the debugger and inspector. [...]
dart:math
Mathematical constants and functions, plus a random number generator. [...]
dart:typed_data
Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]

VM

dart:io
File, socket, HTTP, and other I/O support for non-web applications. [...]
dart:isolate
Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]