multicontroller 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 56

MultiController #

MultiController is a widget that helps to create and dispose of multiple Controller (extending AnimationController), as well as chaining controllers for more advanced animations.

Explanation #

This package was created to abstract away some complexities when implementing advanced animations.

This package allows you to: #

  • Create multiple controllers with the createController method within MultiController's builder method.
  • Call chain(otherController) and chainList(otherController) to start a Controller when another finishes.

See Example for how to use it.

[0.1.1] #

  • Fixed formatting
  • Slight change in README
  • Added MIT license

[0.1.0] #

  • Added docs
  • Added an example
  • Changed README

[0.0.1] #

  • Added a widget test
  • Added MultiController widget

example/multicontroller_example.dart

import 'package:flutter/material.dart';
import 'package:multicontroller/multicontroller.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(
    MaterialApp(
      home: ExampleAnimation(),
    ),
  );
}

class ExampleAnimation extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: MultiController(
            builder: (context, createController, child) {
              // Initializing controllers with the provided createController function.
              Controller finishFirst = createController(
                ControllerData(duration: Duration(seconds: 1)),
              );
              Controller finishLast = createController(
                ControllerData(duration: Duration(seconds: 2), lowerBound: 0.5),
              );
              // Call chain function to start a controller after another finish.
              finishFirst.chain(finishLast);
              finishFirst.forward();
              return Column(
                children: <Widget>[
                  AnimatedBuilder(
                    animation: finishFirst,
                    builder: (context, child) => Text(
                      "This should finish ${finishFirst.value}",
                    ),
                  ),
                  AnimatedBuilder(
                    animation: finishLast,
                    builder: (context, child) => Text(
                      "Before this ${finishLast.value}",
                    ),
                  ),
                ],
              );
            },
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  multicontroller: ^0.1.1

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:multicontroller/multicontroller.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
12
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]
56
Learn more about scoring.

We analyzed this package on Jul 10, 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 not compatible with SDK dart

Because:

  • multicontroller that is a package requiring null.

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.2
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