flutter_animator_widgets 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • new50

animator_widgets #

Provides awesome stylable animated widgets.

Please note that there is currently only one awesome widget: FlyOutMenu, but others will soon follow!

This project uses the flutter_animator project for it's animations. Be sure to check it out.

Getting Started #

FlyOutMenu #

FlyOutMenu

Basic example

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Text(pressedItem != null
            ? "Last pressed: $pressedItem"
            : "No items pressed"),
      ),
      floatingActionButton: FlyOutMenu(
        key: _flyoutMenuKey,
        ///^-- use a global key to call _flyoutMenuKey.currentState.close() on buttonPress.
        buttons: buttons,
        ///^-- List<Widget> so you can add your own widgets and handle the press yourself.
        animation: FlyOutAnimation.flipperCard,
        ///^-- multiple fancy animations available.
        defaultIcon: Icons.add,
        ///^-- icon for standard (closed) state.
        activeIcon: Icons.close,
        ///^-- icon for active (open) state.
      ),
    );
  }

Full working Examples can be found at the example tab. If you like you can also download the example folder to see how this works

[1.0.0] - 2020/03/03. #

  • Initial commit.
  • Added first widget: FlyOutMenu

[1.0.1] - 2020/03/09. #

  • Updated package to support complete rebuild of animator (2.0.0+)

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  GlobalKey<FlyOutMenuState> _flyoutMenuKey = GlobalKey<FlyOutMenuState>();
  List<String> buttonLabels =
      List<String>.generate(4, (index) => "Button ${index + 1}");
  List<Widget> buttons;

  String pressedItem;

  @override
  void initState() {
    WidgetsBinding.instance.addPostFrameCallback((_) {
      setState(() {
        buttons = buttonLabels
            .map((label) => RaisedButton(
                  color: Theme.of(context).buttonColor,
                  onPressed: () {
                    setState(() {
                      pressedItem = label;
                    });
                    _flyoutMenuKey.currentState.close();
                  },
                  child: Text(label),
                ))
            .toList();
      });
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Text(pressedItem != null
            ? "Last pressed: $pressedItem"
            : "No items pressed"),
      ),
      floatingActionButton: FlyOutMenu(
        key: _flyoutMenuKey,
        buttons: buttons,
        animation: FlyOutAnimation.flipperCard,
        defaultIcon: Icons.add,
        activeIcon: Icons.close,
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_animator_widgets: ^1.0.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:flutter_animator_widgets/flutter_animator_widgets.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
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]
50
Learn more about scoring.

We analyzed this package on Mar 27, 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.1.0 <3.0.0
flutter 0.0.0
flutter_animator ^2.0.3 2.0.6
vector_math ^2.0.8 2.0.8
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
Dev dependencies
flutter_test