anim 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 44

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.

0.0.1 #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:anim_example/example2.dart';
import 'package:flutter/material.dart';

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

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

class _MyAppState extends State<MyApp> with TickerProviderStateMixin {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Example2()
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  anim: ^1.0.0

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

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

  • Dart: 2.8.4
  • pana: 0.13.9+1
  • Flutter: 1.17.3

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:anim/anim.dart]

Package does not support Flutter platform macos

Because of import path [package:anim/anim.dart]

Package does not support Flutter platform web

Because of import path [package:anim/anim.dart]

Package does not support Flutter platform windows

Because of import path [package:anim/anim.dart]

Package not compatible with SDK dart

because of import path [anim]

Maintenance suggestions

Package is getting outdated. (-42.19 points)

The package was last published 74 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.0
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8