splash_view.dart 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import 'package:clean/base/base_page.dart';
  2. import 'package:clean/module/main/main_view.dart';
  3. import 'package:clean/module/splash/splash_controller.dart';
  4. import 'package:clean/resource/assets.gen.dart';
  5. import 'package:clean/resource/string.gen.dart';
  6. import 'package:flutter/Material.dart';
  7. import 'package:flutter/cupertino.dart';
  8. import 'package:flutter/src/widgets/framework.dart';
  9. import 'package:flutter_screenutil/flutter_screenutil.dart';
  10. import 'package:get/get_core/src/get_main.dart';
  11. import 'package:lottie/lottie.dart';
  12. class SplashPage extends BasePage<SplashController> {
  13. const SplashPage({super.key});
  14. @override
  15. bool immersive() {
  16. return true;
  17. }
  18. @override
  19. bool statusBarDarkFont() {
  20. return false;
  21. }
  22. @override
  23. Widget buildBody(BuildContext context) {
  24. return Stack(children: [
  25. Container(
  26. width: double.infinity,
  27. height: double.infinity,
  28. child: SafeArea(
  29. child: Column(
  30. crossAxisAlignment: CrossAxisAlignment.center,
  31. mainAxisAlignment: MainAxisAlignment.center,
  32. children: [
  33. SizedBox(
  34. child: Lottie.asset(
  35. Assets.anim.animSplash,
  36. controller: controller.animation,
  37. width: 150.w,
  38. height: 150.w,
  39. repeat: true,
  40. )),
  41. Text(
  42. StringName.appName,
  43. textAlign: TextAlign.center,
  44. style: TextStyle(
  45. color: Colors.white,
  46. fontSize: 24.sp,
  47. fontWeight: FontWeight.w900,
  48. ),
  49. ),
  50. ],
  51. )),
  52. ),
  53. IgnorePointer(
  54. child: Assets.images.bgPhotoSelectedPreviewFinish.image(
  55. width: 360.w,
  56. ),
  57. ),
  58. ]);
  59. }
  60. }