Skip to content

Instantly share code, notes, and snippets.

@felixblaschke
Created November 9, 2019 07:17
bar_chart_2.dart
class Bar extends StatelessWidget {
// ...
@override
Widget build(BuildContext context) {
return ControlledAnimation(
duration: Duration(milliseconds: (height * _baseDurationMs).round()),
tween: Tween(begin: 0.0, end: height),
builder: (context, animatedHeight) {
return Column(
children: <Widget>[
Container(
height: (1 - animatedHeight) * _maxElementHeight,
),
Container(
width: 20,
height: animatedHeight * _maxElementHeight,
color: Colors.blue,
),
Text(label)
],
);
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment