dreampad/lib/app/modules/welcome/views/splash_view.dart
2023-11-29 20:37:45 +08:00

72 lines
2.1 KiB
Dart

import 'package:dreampad/app/shared/shared.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class SplashView extends StatelessWidget {
/// 首次出现的页面
const SplashView({super.key});
@override
Widget build(BuildContext context) {
return buildBody(context);
}
Widget buildBody(BuildContext context) {
return HookBuilder(builder: (context) {
final isStoryShown = useState(false);
return Stack(
children: [
Positioned(
top: 228.h,
left: 0,
right: 0,
child: Center(
child: DefaultTextStyle(
style: TextStyles.mediumWhiteShadowHeight26_034,
child: AnimatedColumnWidget(
children: [
const Text('上古时期,天帝颛顼命重黎绝地天通'),
const Text('斩断了连接天界与人间之桥——建木为重生建木'),
const Text(
'探梦者们踏上了旅途……',
),
Text(
'故事源于《山海经·大荒西经》',
style: TextStyles.mediumWhiteShadow16_034,
),
],
onDone: () {
isStoryShown.value = true;
},
),
),
),
),
Positioned(
bottom: 5.h,
left: 0,
right: 0,
child: Center(
child: AnimatedVisibilityWidget(
isVisible: isStoryShown.value,
child: IgnorePointer(
ignoring: !isStoryShown.value,
child: SwipeNextPageHandler(
child: Column(
children: [
Images.up,
Images.splashBegin,
],
),
),
),
),
),
),
],
);
});
}
}