2023-11-29 20:37:45 +08:00
|
|
|
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(
|
2023-11-30 16:36:14 +08:00
|
|
|
top: 200.h,
|
2023-11-29 20:37:45 +08:00
|
|
|
left: 0,
|
|
|
|
right: 0,
|
|
|
|
child: Center(
|
|
|
|
child: DefaultTextStyle(
|
|
|
|
style: TextStyles.mediumWhiteShadowHeight26_034,
|
|
|
|
child: AnimatedColumnWidget(
|
|
|
|
children: [
|
2023-11-30 16:36:14 +08:00
|
|
|
Images.splashFirstLine,
|
|
|
|
Images.splashSecondLine,
|
|
|
|
Images.splashThirdLine,
|
|
|
|
Images.splashFourthLine,
|
2023-11-29 20:37:45 +08:00
|
|
|
],
|
|
|
|
onDone: () {
|
|
|
|
isStoryShown.value = true;
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
bottom: 5.h,
|
|
|
|
left: 0,
|
|
|
|
right: 0,
|
|
|
|
child: Center(
|
|
|
|
child: AnimatedVisibilityWidget(
|
|
|
|
isVisible: isStoryShown.value,
|
2023-11-30 14:58:48 +08:00
|
|
|
animationWidgetBuilder: AnimatedVisibilityWidget.fadeAnimationWidgetBuilder,
|
2023-11-29 20:37:45 +08:00
|
|
|
child: IgnorePointer(
|
|
|
|
ignoring: !isStoryShown.value,
|
|
|
|
child: SwipeNextPageHandler(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Images.up,
|
|
|
|
Images.splashBegin,
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|