1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. Get.off(Home());
  14. // Get.toNamed("/addressList");
  15. }
  16. @override
  17. Widget build(BuildContext context) {
  18. return Scaffold(
  19. body: Container(
  20. decoration: const BoxDecoration(
  21. image: DecorationImage(
  22. image: AssetImage("images/splash.png"),
  23. fit: BoxFit.cover,
  24. alignment: Alignment.topCenter),
  25. ),
  26. child: Stack(
  27. children: [
  28. Positioned(
  29. right: 15.w,
  30. top: 50.h,
  31. child: countdown(3, handleOnFinish),
  32. ),
  33. Positioned(
  34. bottom: 0,
  35. child: Container(
  36. width: 375.w,
  37. height: 60.w,
  38. child: Center(
  39. child: Image.asset(
  40. 'images/logo.png',
  41. width: 218.w,
  42. height: 50.w,
  43. ),
  44. ),
  45. ),
  46. ),
  47. ],
  48. ),
  49. ));
  50. }
  51. }