dreampad/lib/app/modules/splash/views/splash_view.dart

101 lines
2.9 KiB
Dart
Raw Normal View History

2023-11-28 10:44:58 +08:00
import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:dreampad/app/routes/app_pages.dart';
import 'package:dreampad/app/shared/shared.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../controllers/splash_controller.dart';
class SplashView extends GetView<SplashController> {
2023-11-29 20:37:45 +08:00
const SplashView({super.key});
2023-11-28 10:44:58 +08:00
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: Images.splashBg,
fit: BoxFit.fill,
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
body: buildBody(context),
),
),
);
}
Widget buildBody(BuildContext context) {
2023-11-29 20:37:45 +08:00
return Stack(
children: [
Positioned(
top: 228.h,
child: Center(
child: DefaultTextStyle(
style: TextStyles.mediumWhiteShadowHeight26_034,
child: AnimatedTextKit(
totalRepeatCount: 1,
animatedTexts: [
TypewriterAnimatedText(
'上古时期,天帝颛顼命重黎绝地天通斩断了连接天界与人间之桥——建木为重生建木,探梦者们踏上了旅途……',
speed: const Duration(milliseconds: 150),
cursor: '',
),
],
onFinished: () {
},
),
),
),
),
Positioned(
left: 483.w,
top: 367.h,
2023-11-28 10:44:58 +08:00
child: RSizedBox(
2023-11-29 20:37:45 +08:00
width: 260.0,
2023-11-28 10:44:58 +08:00
child: DefaultTextStyle(
2023-11-29 20:37:45 +08:00
style: TextStyles.mediumWhiteShadow16_034,
2023-11-28 10:44:58 +08:00
child: AnimatedTextKit(
totalRepeatCount: 1,
animatedTexts: [
TypewriterAnimatedText(
2023-11-29 20:37:45 +08:00
'故事源于《山海经·大荒西经》',
2023-11-28 10:44:58 +08:00
speed: const Duration(milliseconds: 150),
cursor: '',
),
],
onFinished: () {
2023-11-29 20:37:45 +08:00
2023-11-28 10:44:58 +08:00
},
),
),
2023-11-29 20:37:45 +08:00
)),
Positioned(
left: 564.w,
bottom: 120.h,
child: GestureDetector(
onVerticalDragStart: (details) async {
await Get.offAllNamed(Routes.WELCOME);
},
child: Images.up,
2023-11-28 10:44:58 +08:00
),
2023-11-29 20:37:45 +08:00
),
Positioned(
left: 402.w,
bottom: 33.h,
child: GestureDetector(
onVerticalDragStart: (details) async {
await Get.offAllNamed(Routes.WELCOME);
},
child: Images.splashBegin,
2023-11-28 10:44:58 +08:00
),
2023-11-29 20:37:45 +08:00
),
],
2023-11-28 10:44:58 +08:00
);
}
}