splash.dart 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import 'package:farmer_client/pages/splash/widgets/countdown.dart';
  2. import 'package:get/get.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import 'package:flutter/material.dart';
  5. import '../home/index.dart';
  6. class SplashScreen extends StatefulWidget {
  7. const SplashScreen({Key? key}) : super(key: key);
  8. @override
  9. State<SplashScreen> createState() => _SplashScreen();
  10. }
  11. class _SplashScreen extends State<SplashScreen> {
  12. handleOnFinish() {
  13. print(99999);
  14. // Get.off(Home());
  15. Get.toNamed("/addressList");
  16. }
  17. @override
  18. Widget build(BuildContext context) {
  19. return Scaffold(
  20. body: Container(
  21. decoration: const BoxDecoration(
  22. image: DecorationImage(
  23. image: AssetImage("images/splash.png"),
  24. fit: BoxFit.cover,
  25. alignment: Alignment.topCenter),
  26. ),
  27. child: Stack(
  28. children: [
  29. Positioned(
  30. right: 15.w,
  31. top: 50.h,
  32. child: countdown(3, handleOnFinish),
  33. ),
  34. Positioned(
  35. bottom: 0,
  36. child: Container(
  37. width: 375.w,
  38. height: 60.w,
  39. child: Center(
  40. child: Image.asset(
  41. 'images/logo.png',
  42. width: 218.w,
  43. height: 50.w,
  44. ),
  45. ),
  46. ),
  47. ),
  48. ],
  49. ),
  50. ));
  51. }
  52. }