splash_page.dart 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_news/routes.dart';
  3. class SplashPage extends StatefulWidget {
  4. const SplashPage({super.key});
  5. @override
  6. State<SplashPage> createState() => _SplashPageState();
  7. }
  8. class _SplashPageState extends State<SplashPage> {
  9. Size get _size => MediaQuery.of(context).size;
  10. @override
  11. Widget build(BuildContext context) {
  12. return Scaffold(
  13. body: Stack(
  14. children: [
  15. Image.asset(
  16. "assets/images/splash.gif",
  17. width: _size.width,
  18. height: _size.height,
  19. fit: BoxFit.cover,
  20. ),
  21. Positioned(
  22. child: GestureDetector(
  23. onTap: () {
  24. Routes.go(context, Routes.home, replace: true);
  25. },
  26. child: Container(
  27. margin: EdgeInsets.all(10.0),
  28. child: DownTime(
  29. clors: Colors.red,
  30. time: 5000,
  31. width: 50,
  32. strokeWidth: 5.0,
  33. textStyle: TextStyle(
  34. color: Colors.black,
  35. fontSize: 8.0,
  36. decoration: TextDecoration.none),
  37. endListener: () {
  38. Routes.go(context, Routes.home, replace: true);
  39. },
  40. ),
  41. ),
  42. ),
  43. top: 2.0,
  44. right: 2.0,
  45. ),
  46. ],
  47. ));
  48. }
  49. // void showNextPage() {
  50. // Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) {
  51. // SystemChrome.setEnabledSystemUIOverlays(
  52. // [SystemUiOverlay.top, SystemUiOverlay.bottom]);
  53. // SystemUiOverlayStyle systemUiOverlayStyle =
  54. // SystemUiOverlayStyle(statusBarColor: Colors.transparent);
  55. // SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
  56. // return HomePage();
  57. // }), (route) => route == null);
  58. // }
  59. }