import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; /// Description: count down for splash /// Time : 02/21/2024 Wednesday /// Author : liuyuqi.gov@msn.cn class Countdown extends StatefulWidget { const Countdown({Key? key}) : super(key: key); @override State createState() => _CountdownState(); } class _CountdownState extends State { late Animation _animation; late AnimationController _controller; @override Widget build(BuildContext context) { return GestureDetector( child: Container( color: const Color(0xFF1E90FF), child: Center( child: AnimatedBuilder( animation: _animation, builder: (context, child) { return Text( '${_animation.value.toInt()}', style: const TextStyle( fontSize: 60, color: Colors.white, ), ); }, ), ), )); } @override void initState() { super.initState(); SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( statusBarBrightness: Brightness.light, statusBarIconBrightness: Brightness.light, )); } @override void dispose() { super.dispose(); _controller.dispose(); } }