68 lines
1.9 KiB
Dart
68 lines
1.9 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: 200.h,
|
|
left: 0,
|
|
right: 0,
|
|
child: Center(
|
|
child: DefaultTextStyle(
|
|
style: TextStyles.mediumWhiteShadowHeight26_034,
|
|
child: AnimatedColumnWidget(
|
|
children: [
|
|
Images.splashFirstLine,
|
|
Images.splashSecondLine,
|
|
Images.splashThirdLine,
|
|
Images.splashFourthLine,
|
|
],
|
|
onDone: () {
|
|
isStoryShown.value = true;
|
|
},
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 5.h,
|
|
left: 0,
|
|
right: 0,
|
|
child: Center(
|
|
child: AnimatedVisibilityWidget(
|
|
isVisible: isStoryShown.value,
|
|
animationWidgetBuilder: AnimatedVisibilityWidget.fadeAnimationWidgetBuilder,
|
|
child: IgnorePointer(
|
|
ignoring: !isStoryShown.value,
|
|
child: SwipeNextPageHandler(
|
|
child: Column(
|
|
children: [
|
|
Images.up,
|
|
Images.splashBegin,
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
});
|
|
}
|
|
}
|