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

101 lines
2.9 KiB
Dart

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> {
const SplashView({super.key});
@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) {
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,
child: RSizedBox(
width: 260.0,
child: DefaultTextStyle(
style: TextStyles.mediumWhiteShadow16_034,
child: AnimatedTextKit(
totalRepeatCount: 1,
animatedTexts: [
TypewriterAnimatedText(
'故事源于《山海经·大荒西经》',
speed: const Duration(milliseconds: 150),
cursor: '',
),
],
onFinished: () {
},
),
),
)),
Positioned(
left: 564.w,
bottom: 120.h,
child: GestureDetector(
onVerticalDragStart: (details) async {
await Get.offAllNamed(Routes.WELCOME);
},
child: Images.up,
),
),
Positioned(
left: 402.w,
bottom: 33.h,
child: GestureDetector(
onVerticalDragStart: (details) async {
await Get.offAllNamed(Routes.WELCOME);
},
child: Images.splashBegin,
),
),
],
);
}
}