auto_animated 1.2.2

  • Readme
  • Changelog
  • Example
  • Installing
  • new79

Auto animated #

Auto animated widgets for flutter Already added:

  • AutoAnimatedList
  • AutoAnimatedIconButton

Screenshots #

Getting Started #

In your flutter project add the dependency:

pub package

dependencies:
  ...
  auto_animated: any

For help getting started with Flutter, view the online documentation.

AutoAnimatedList usage example

Make an automatically animated list in 2 minutes? Easily! #

AutoAnimatedList(
    // Start animation after (default zero)
    delay: Duration(seconds: 1),
    // Show each item through
    showItemInterval: Duration(milliseconds: 500),
    // Animation duration
    showItemDuration: Duration(seconds: 1),
    // Other properties correspond to the `ListView` widget
    scrollDirection: Axis.horizontal,
    itemsCount: 10,
    itemBuilder: _buildAnimatedItem,
)

// Build item
Widget _buildAnimatedItem(
    BuildContext context,
    int index,
    Animation<double> animation,
) =>
    // Wrap with fade transition
    FadeTransition(
        opacity: Tween<double>(
            begin: 0,
            end: 1,
        ).animate(animation),
        // And slide transition
        child: SlideTransition(
            position: Tween<Offset>(
                begin: Offset(0, -0.1),
                end: Offset.zero,
            ).animate(animation),
            // Paste you Widget
            child: YouWidgetHere(),
        ),
    )

AutoAnimatedIconButton usage example

Basic #

AutoAnimatedIconButton(
    icon: AnimatedIcons.arrow_menu,
    onPressed: () {},
)

With separate toolips #

AutoAnimatedIconButton(
    icon: AnimatedIcons.arrow_menu,
    firstToolip: 'Event',
    secondToolip: 'Add',
)

1.2.2 #

  • Fixed dispose in AutoAnimatedIconButton

1.2.1 #

  • Fixed auto setting state on rebuild widget for AutoAnimatedIconButton

1.2.0 #

  • Added constructor AutoAnimatedIconButton.externalState with iconState property

1.1.0 #

  • Added AutoAnimatedListState.sepparated
  • Added AutoAnimatedIconButton
  • Optimized perfomance

1.0.1 #

  • Fixed screenshots paths for pub.dev

1.0.0 #

  • Initial release.

example/README.md

Example of usage auto_animated

import 'package:flutter/material.dart';

import 'package:auto_animated/auto_animated.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) => MaterialApp(
        home: Scaffold(
          backgroundColor: Colors.grey[100],
          appBar: AppBar(
            title: Text('Auto animated example'),
            leading: AutoAnimatedIconButton(
              icon: AnimatedIcons.menu_close,
              firstToolip: 'Menu',
              secondToolip: 'Close',
              onPressed: () {},
            ),
          ),
          body: Column(
            children: <Widget>[
              SizedBox(
                height: 200,
                child: AutoAnimatedList(
                  showItemInterval: Duration(milliseconds: 500),
                  showItemDuration: Duration(seconds: 1),
                  padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 24),
                  scrollDirection: Axis.horizontal,
                  itemsCount: 10,
                  itemBuilder: _buildAnimatedItem,
                ),
              ),
            ],
          ),
        ),
      );

  /// Wrap Ui item with animation & padding
  Widget _buildAnimatedItem(
    BuildContext context,
    int index,
    Animation<double> animation,
  ) =>
      FadeTransition(
        opacity: Tween<double>(
          begin: 0,
          end: 1,
        ).animate(animation),
        child: SlideTransition(
          position: Tween<Offset>(
            begin: Offset(0, -0.1),
            end: Offset.zero,
          ).animate(animation),
          child: Padding(
            padding: EdgeInsets.only(right: 32),
            child: _buildCard(index.toString()),
          ),
        ),
      );

  /// UI item for showing
  Widget _buildCard(String text) => Builder(
        builder: (context) => Container(
          width: 140,
          child: ClipRRect(
            borderRadius: BorderRadius.circular(4),
            child: Material(
              color: Colors.lime,
              child: Center(
                child: Text(
                  text,
                  style: Theme.of(context)
                      .textTheme
                      .display1
                      .copyWith(color: Colors.black),
                ),
              ),
            ),
          ),
        ),
      );
}

Use this package as a library

1. Depend on it

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


dependencies:
  auto_animated: ^1.2.2

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

We analyzed this package on Oct 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test