| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- import 'package:animate_do/animate_do.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:flutter_spinkit/flutter_spinkit.dart';
- import 'package:get/get.dart';
- import 'package:nomo/app/base/base_view.dart';
- import 'package:nomo/app/widgets/ix_image.dart';
- import 'package:nomo/config/theme/theme_extensions/theme_extension.dart';
- import '../../../constants/assets.dart';
- import '../../../widgets/privacy_agreement.dart';
- import '../controllers/splash_controller.dart';
- class SplashView extends BaseView<SplashController> {
- const SplashView({super.key});
- @override
- bool get resizeToAvoidBottomInset => false;
- @override
- Widget buildContent(BuildContext context) {
- return SafeArea(
- child: Column(
- children: [
- Expanded(child: _buildContent()),
- // 底部内容
- _buildBottomContent(),
- ],
- ),
- );
- }
- // 已登录状态的内容
- Widget _buildContent() {
- return Center(
- child: Stack(
- alignment: Alignment.topCenter,
- children: [
- Container(
- margin: EdgeInsets.only(top: 120.w),
- child: IXImage(
- source: Assets.splashCenterBg,
- width: 356.w,
- height: 356.w,
- sourceType: ImageSourceType.asset,
- ),
- ),
- Container(
- margin: EdgeInsets.only(top: 52.w),
- child: IXImage(
- source: Assets.splashLogo,
- width: 104.w,
- height: 148.w,
- sourceType: ImageSourceType.asset,
- ),
- ),
- ],
- ),
- );
- }
- // 构建底部内容
- Widget _buildBottomContent() {
- return Obx(
- () => !controller.hasLogin
- ? FadeInUp(
- duration: const Duration(milliseconds: 700),
- delay: const Duration(milliseconds: 800),
- child: PrivacyAgreement(
- textColor: Get.reactiveTheme.textTheme.bodyLarge!.color,
- linkColor: Get.reactiveTheme.primaryColor,
- height: 1.8,
- ),
- )
- : FadeInUp(
- duration: const Duration(milliseconds: 600),
- child: Column(
- children: [
- Obx(
- () => controller.showLoading
- ? SpinKitRing(
- size: 24.w,
- lineWidth: 2.w,
- color: Get.reactiveTheme.primaryColor,
- )
- : const SizedBox.shrink(),
- ),
- 16.verticalSpaceFromWidth,
- Text(
- 'V${controller.versionName}',
- textAlign: TextAlign.center,
- style: TextStyle(
- color: Get.reactiveTheme.textTheme.bodyLarge!.color,
- fontSize: 14.sp,
- ),
- ),
- ],
- ),
- ),
- );
- }
- }
|