From af57daa7f9e467c38fc7e632889f9da6f30fb29f Mon Sep 17 00:00:00 2001 From: tanghong668 <13926187239@163.com> Date: Thu, 30 Nov 2023 12:23:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=81=8C=E4=B8=9A?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/app/modules/select/controllers/select_controller.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/app/modules/select/controllers/select_controller.dart b/lib/app/modules/select/controllers/select_controller.dart index 3e940ce..7b029a3 100644 --- a/lib/app/modules/select/controllers/select_controller.dart +++ b/lib/app/modules/select/controllers/select_controller.dart @@ -72,7 +72,7 @@ class SelectController extends GetxController { enName: 'artist', vImage: 'btn_male_pic_artist', hImage: 'pic_male_artist', - selected: true, + selected: false, enable: true, )); occupations.add(Occupation( @@ -122,7 +122,7 @@ class SelectController extends GetxController { enName: 'academician', vImage: 'btn_female_pic_academician', hImage: 'pic_female_academician', - enable: true, + enable: false, )); occupations.add(Occupation( id: 2, @@ -157,7 +157,7 @@ class SelectController extends GetxController { enName: 'artist', vImage: 'btn_female_pic_artist', hImage: 'pic_female_artist', - selected: true, + selected: false, enable: true, )); occupations.add(Occupation( From 27caadd3e9e025185a8c560faedb889676a5ff9c Mon Sep 17 00:00:00 2001 From: tanghong668 <13926187239@163.com> Date: Thu, 30 Nov 2023 12:34:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=81=AF=E7=AC=BC=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=9C=A8=E5=8F=B6=E5=AD=90=E5=87=BA=E7=8E=B0=E5=90=8E=E5=87=BA?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/app/modules/home/views/home_view.dart | 12 +++-- .../modules/home/widgets/lantern_widget.dart | 54 ++++++++++--------- lib/app/shared/widgets/show_up.dart | 24 +++++++++ lib/app/shared/widgets/widgets.dart | 3 +- 4 files changed, 61 insertions(+), 32 deletions(-) create mode 100644 lib/app/shared/widgets/show_up.dart diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart index 7d1e2bb..041da3f 100644 --- a/lib/app/modules/home/views/home_view.dart +++ b/lib/app/modules/home/views/home_view.dart @@ -513,11 +513,13 @@ class HomeView extends GetView { ) : Container(), controller.explored2.value >= 1 ? firstLeafWidget() : Container(), - LanternWidget( - brightCount: controller.exploreCount.value >= 2 - ? controller.exploreDay.value - : controller.exploreDay.value - 1, - ), + controller.explored2.value >= 4 + ? LanternWidget( + brightCount: controller.exploreCount.value >= 2 + ? controller.exploreDay.value + : controller.exploreDay.value - 1, + ) + : Container(), Positioned( left: 168.w, top: 244.h, diff --git a/lib/app/modules/home/widgets/lantern_widget.dart b/lib/app/modules/home/widgets/lantern_widget.dart index 94f2c6d..48802b4 100644 --- a/lib/app/modules/home/widgets/lantern_widget.dart +++ b/lib/app/modules/home/widgets/lantern_widget.dart @@ -15,33 +15,35 @@ class LanternWidget extends GetView { return Positioned( right: 60.w, top: 346.h, - child: Container( - height: 90.h, - width: 180.w, - decoration: const BoxDecoration( - image: DecorationImage( - image: Images.homeLantern, - fit: BoxFit.fill, + child: ShowUp( + child: Container( + height: 90.h, + width: 180.w, + decoration: const BoxDecoration( + image: DecorationImage( + image: Images.homeLantern, + fit: BoxFit.fill, + ), + ), + child: Stack( + clipBehavior: Clip.none, + children: [ + brightCount! >= 1 + ? Positioned( + left: -9.w, + top: 36.h, + child: Images.homeLanternBright, + ) + : Container(), + brightCount! >= 2 + ? Positioned( + left: 18.w, + top: 27.h, + child: Images.homeLanternBright, + ) + : Container(), + ], ), - ), - child: Stack( - clipBehavior: Clip.none, - children: [ - brightCount! >= 1 - ? Positioned( - left: -9.w, - top: 36.h, - child: Images.homeLanternBright, - ) - : Container(), - brightCount! >= 2 - ? Positioned( - left: 18.w, - top: 27.h, - child: Images.homeLanternBright, - ) - : Container(), - ], ), ), ); diff --git a/lib/app/shared/widgets/show_up.dart b/lib/app/shared/widgets/show_up.dart new file mode 100644 index 0000000..aade0da --- /dev/null +++ b/lib/app/shared/widgets/show_up.dart @@ -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, + ); + } +} \ No newline at end of file diff --git a/lib/app/shared/widgets/widgets.dart b/lib/app/shared/widgets/widgets.dart index 4998458..8721b5c 100644 --- a/lib/app/shared/widgets/widgets.dart +++ b/lib/app/shared/widgets/widgets.dart @@ -9,4 +9,5 @@ export 'my_back_button.dart'; export 'question_dialog.dart'; export 'swipe_next_page_container.dart'; export 'animated_visibility_widget.dart'; -export 'animated_column_widget.dart'; \ No newline at end of file +export 'animated_column_widget.dart'; +export 'show_up.dart'; \ No newline at end of file