widget_fader 0.0.7 copy "widget_fader: ^0.0.7" to clipboard
widget_fader: ^0.0.7 copied to clipboard

outdated

Cross-fades widgets in both directions, automatically or not.

widget_fader #

Cross-fades widgets in both directions. Supports:

  • Infinite cross-fading in both directions
  • Swipe to fade
  • Fading via the functions next() and previous()

Example #

Installation #

Add widget_fader: ^0.0.7 in your pubspec.yaml dependencies. And import it:

import 'package:widget_fader/widget_fader.dart';

How to use #

List<Widget> _buildWidgetFaderChildren() {
    var assetPath = "assets/widgetFader";

    return List.generate(
      3, 
      (i) => Container(
        child: Image.asset(
          assetPath + i.toString() + ".jpg",
          fit: BoxFit.cover,
        ),
      )
    );
}

WidgetFader _buildWidgetFader() => WidgetFader(
    children: _buildWidgetFaderChildren(),
    fadeDuration: 750,
    pauseDuration: 750,
    cover: Column(
      children: <Widget>[
        Expanded(child: Container()),
        Container(
          height: 150,
          decoration: BoxDecoration(
            image: DecorationImage(
              image: AssetImage("assets/widgetFaderCover.jpg"),
              fit: BoxFit.cover
            )
          ),
        )
      ],
    ),
);

Future functionality #

  • Got any ideas? Make a feature request at the repo or contact me.
  • Rotation
  • Scaling
0
likes
0
pub points
21%
popularity

Publisher

unverified uploader

Cross-fades widgets in both directions, automatically or not.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

carousel_slider, flutter, rxdart

More

Packages that depend on widget_fader