dreampad/lib/app/modules/home/widgets/first_time_dialog.dart

58 lines
1.8 KiB
Dart
Raw Normal View History

2023-11-28 10:44:58 +08:00
import 'package:dreampad/app/shared/shared.dart';
2023-11-29 20:37:45 +08:00
import 'package:dreampad/app/shared/widgets/touch_hint_widget.dart';
2023-11-28 10:44:58 +08:00
import 'package:flutter/material.dart';
2023-11-29 20:37:45 +08:00
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
2023-11-28 10:44:58 +08:00
/// 首次dialog的模板
class FirstTimeDialog extends StatelessWidget {
const FirstTimeDialog({
super.key,
});
@override
Widget build(BuildContext context) {
2023-11-29 20:37:45 +08:00
return HookBuilder(
builder: (context) {
final isTextShown = useState(false);
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: isTextShown.value ? () {
SmartDialog.dismiss(result: true);
}: null,
child: Stack(
children: [
Center(
child: AnimatedColumnWidget(
mainAxisSize: MainAxisSize.min,
onDone: () {
isTextShown.value = true;
},
children: [
2023-11-30 16:36:14 +08:00
Images.homeTextDreamTreePageFirstLine,
Images.homeTextDreamTreePageSecondLine,
Images.homeTextDreamTreePageThirdLine,
Images.homeTextDreamTreePageFourthLine,
2023-11-29 20:37:45 +08:00
],
),
),
Positioned(
bottom: 32,
left: 0,
right: 0,
child: AnimatedVisibilityWidget(
2023-11-30 10:16:09 +08:00
animationWidgetBuilder: AnimatedVisibilityWidget.fadeAnimationWidgetBuilder,
2023-11-29 20:37:45 +08:00
isVisible: isTextShown.value,
child: const Center(
child: TouchHintWidget(),
),
),
),
],
2023-11-28 10:44:58 +08:00
),
2023-11-29 20:37:45 +08:00
);
}
2023-11-28 10:44:58 +08:00
);
}
}