Skip to content

Instantly share code, notes, and snippets.

@RandalSchwartz
Created February 2, 2024 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RandalSchwartz/9350bd8621a3f7114fc7abcc5193fde8 to your computer and use it in GitHub Desktop.
Save RandalSchwartz/9350bd8621a3f7114fc7abcc5193fde8 to your computer and use it in GitHub Desktop.
digits using flutter_animate
class Digits extends StatelessWidget {
const Digits({super.key, this.prefix = ''});
final String prefix;
@override
Widget build(BuildContext context) => Animate(
onPlay: (controller) => controller.repeat(),
).custom(
builder: (_, double value, __) {
return Text(
prefix + DateFormat('mm:ss').format(DateTime.now()),
style: Theme.of(context).textTheme.headlineLarge!.copyWith(
fontWeight: FontWeight.bold,
fontFeatures: [const FontFeature.tabularFigures()],
),
);
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment