灯笼需要在叶子出现后出现

This commit is contained in:
tanghong668 2023-11-30 12:34:48 +08:00
parent af57daa7f9
commit 27caadd3e9
4 changed files with 61 additions and 32 deletions

View File

@ -513,11 +513,13 @@ class HomeView extends GetView<HomeController> {
) )
: Container(), : Container(),
controller.explored2.value >= 1 ? firstLeafWidget() : Container(), controller.explored2.value >= 1 ? firstLeafWidget() : Container(),
LanternWidget( controller.explored2.value >= 4
? LanternWidget(
brightCount: controller.exploreCount.value >= 2 brightCount: controller.exploreCount.value >= 2
? controller.exploreDay.value ? controller.exploreDay.value
: controller.exploreDay.value - 1, : controller.exploreDay.value - 1,
), )
: Container(),
Positioned( Positioned(
left: 168.w, left: 168.w,
top: 244.h, top: 244.h,

View File

@ -15,6 +15,7 @@ class LanternWidget extends GetView {
return Positioned( return Positioned(
right: 60.w, right: 60.w,
top: 346.h, top: 346.h,
child: ShowUp(
child: Container( child: Container(
height: 90.h, height: 90.h,
width: 180.w, width: 180.w,
@ -44,6 +45,7 @@ class LanternWidget extends GetView {
], ],
), ),
), ),
),
); );
} }
} }

View File

@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
class ShowUp extends HookWidget {
const ShowUp({
super.key,
required this.child,
});
final Widget child;
@override
Widget build(BuildContext context) {
final controller =
useAnimationController(duration: const Duration(milliseconds: 300));
useMemoized(() {
controller.forward();
});
return FadeTransition(
opacity: CurvedAnimation(curve: Curves.easeIn, parent: controller),
child: child,
);
}
}

View File

@ -10,3 +10,4 @@ export 'question_dialog.dart';
export 'swipe_next_page_container.dart'; export 'swipe_next_page_container.dart';
export 'animated_visibility_widget.dart'; export 'animated_visibility_widget.dart';
export 'animated_column_widget.dart'; export 'animated_column_widget.dart';
export 'show_up.dart';