splash_page.dart 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import 'package:app/router/page/app_page_router.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:hooks_riverpod/hooks_riverpod.dart';
  4. import 'package:cs_resources/generated/assets.dart';
  5. import 'package:router/componentRouter/app_service.dart';
  6. import 'package:router/path/router_path.dart';
  7. import 'package:shared/utils/size_config.dart';
  8. import 'package:widgets/dialog/custom_error_widget.dart';
  9. import 'package:widgets/ext/ex_widget.dart';
  10. import 'package:widgets/my_load_image.dart';
  11. import 'package:auto_route/annotations.dart';
  12. import '../vm/splash_view_model.dart';
  13. import 'package:auto_route/auto_route.dart';
  14. @RoutePage()
  15. class SplashPage extends HookConsumerWidget {
  16. const SplashPage({super.key});
  17. @override
  18. Widget build(BuildContext context, WidgetRef ref) {
  19. SizeConfig().init(context);
  20. final viewModel = ref.watch(splashViewModelProvider.notifier)..setContext(context);
  21. return Scaffold(
  22. body: Container(
  23. decoration: const BoxDecoration(
  24. gradient: LinearGradient(
  25. colors: [
  26. Color(0xFF091D44),
  27. Color(0xFF245A8A),
  28. Color(0xFF7F7CEC),
  29. ],
  30. begin: Alignment.topCenter,
  31. end: Alignment.bottomCenter,
  32. ),
  33. ),
  34. child: Center(
  35. child: const MyAssetImage(
  36. Assets.assetsYyBusinessTopLogo,
  37. width: 166,
  38. height: 67.5,
  39. fit: BoxFit.contain,
  40. ).onTap((){
  41. context.router.pushNamed(RouterPath.main);
  42. }),
  43. ),
  44. ),
  45. );
  46. }
  47. }