fade 1.0.0

Flutter Android iOS web

A Widget that animates its visible property with fade and size transitions

fade #

pub package A Widget that animates its visible property with fade and size (height) transitions made on child widget. It allows declarative UI without code smell like animation controller for each widget that should fade away. The Widget works on bounded and unbounded constraints, so height doesn't need to be explicitly provided to the child widget.

The library provides one widget Fade and depends only on Flutter framework.

Example #

Usage #

Let's see a basic demo:

class MyPage extends StatefulWidget {
  @override
  _MyPageState createState() => _MyPageState();
}

class _MyPageState_ extends State<MyPage> {
  bool visible = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: GestureDetector(
          onTap: () => setState(() => visible = !visible),
          child: Column(
            children: <Widget>[
              Container(
                height: 200,
                color: Colors.blue,
              ),
              Fade(
                visible: visible,
                // duration is optional
                duration: Duration(milliseconds: 400),
                child: Container(
                  height: 200,
                  color: Colors.green,
                ),
              ),
              Container(
                height: 200,
                color: Colors.red,
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Contributors #

1
likes
100
pub points
77%
popularity

A Widget that animates its visible property with fade and size transitions

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

wojtczakmat@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on fade