flutter flip panel
a flutter package for flip panel with built-in animation.
how to use
import 'package:flip_panel/flip_panel.dart';
create a flip-panel from iterable source:
final digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
flippanel.builder(
itembuilder: (context, index) => container(
color: colors.black,
padding: const edgeinsets.symmetric(horizontal: 6.0),
child: text(
'${digits[index]}',
style: textstyle(
fontweight: fontweight.bold,
fontsize: 50.0,
color: colors.white),
),
),
itemscount: digits.length,
period: const duration(milliseconds: 1000),
loop: 1,
)
create a flip-panel from stream source:
flippanel<int>.stream(
itemstream: stream.periodic(duration(milliseconds: 1000), (count) => count % 10),
itembuilder: (context, value) => container(
color: colors.black,
padding: const edgeinsets.symmetric(horizontal: 6.0),
child: text(
'$value',
style: textstyle(
fontweight: fontweight.bold,
fontsize: 50.0,
color: colors.white
),
),
),
initvalue: 0,
);
Comments are closed.