import 'package:flutter/material.dart'; import 'package:flutter_news/routes.dart'; class SplashPage extends StatefulWidget { const SplashPage({super.key}); @override State createState() => _SplashPageState(); } class _SplashPageState extends State { Size get _size => MediaQuery.of(context).size; @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ Image.asset( "assets/images/splash.gif", width: _size.width, height: _size.height, fit: BoxFit.cover, ), Positioned( child: GestureDetector( onTap: () { Routes.go(context, Routes.home, replace: true); }, child: Container( margin: EdgeInsets.all(10.0), child: DownTime( clors: Colors.red, time: 5000, width: 50, strokeWidth: 5.0, textStyle: TextStyle( color: Colors.black, fontSize: 8.0, decoration: TextDecoration.none), endListener: () { Routes.go(context, Routes.home, replace: true); }, ), ), ), top: 2.0, right: 2.0, ), ], )); } // void showNextPage() { // Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) { // SystemChrome.setEnabledSystemUIOverlays( // [SystemUiOverlay.top, SystemUiOverlay.bottom]); // SystemUiOverlayStyle systemUiOverlayStyle = // SystemUiOverlayStyle(statusBarColor: Colors.transparent); // SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); // return HomePage(); // }), (route) => route == null); // } }