Last updated:
0 purchases
widget fader
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.1.0 in your pubspec.yaml dependencies. And import it:
import 'package:widget_fader/widget_fader.dart';
copied to clipboard
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
)
),
)
],
),
);
copied to clipboard
Future functionality #
Got any ideas? Make a feature request at the repo or contact me.
Rotation
Scaling
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.