splash_view.dart 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import '../../../common/api/index.dart';
  4. import '../../../common/style/index.dart';
  5. import '../../../common/widgets/assets_image_view.dart';
  6. import '../index.dart';
  7. /// splash view
  8. class SplashView extends GetView<SplashController> {
  9. const SplashView({Key? key}) : super(key: key);
  10. @override
  11. Widget build(BuildContext context) {
  12. return Stack(
  13. children: [
  14. const Positioned.fill(
  15. child: AssetsImageView(
  16. 'launch_background.png',
  17. fit: BoxFit.cover,
  18. ),
  19. ),
  20. Positioned.fill(
  21. child: Column(
  22. crossAxisAlignment: CrossAxisAlignment.center,
  23. children: [
  24. const SizedBox(height: 100),
  25. Text(
  26. 'appName'.tr,
  27. style: Theme.of(context)
  28. .textTheme
  29. .headlineMedium
  30. ?.copyWith(color: AppColor.primaryText),
  31. ),
  32. const SizedBox(height: 24),
  33. Obx(() => controller.state.showLaunchLogo
  34. ? ProgramCenterService.to.launchLogoImageView()
  35. : const SizedBox(height: 128))
  36. ],
  37. )),
  38. Positioned(
  39. right: 20,
  40. bottom: 64,
  41. child: Obx(() {
  42. return Text(
  43. '${controller.state.tips}',
  44. style: TextStyle(color: Theme.of(context).colorScheme.primary),
  45. );
  46. })),
  47. Positioned(
  48. bottom: 32,
  49. left: 0,
  50. right: 0,
  51. child: Obx(() => Center(
  52. child: Text(
  53. controller.state.copyright,
  54. style: Theme.of(context)
  55. .textTheme
  56. .bodyMedium
  57. ?.copyWith(color: AppColor.primaryText),
  58. ))))
  59. ],
  60. );
  61. }
  62. }