From f1c7279bfb5099a13e7036c81828ff873d52e6a2 Mon Sep 17 00:00:00 2001 From: tanghong668 <13926187239@163.com> Date: Tue, 28 Nov 2023 17:57:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/app/modules/home/views/home_view.dart | 230 ++++++++++------------ lib/app/routes/app_pages.dart | 2 +- 2 files changed, 106 insertions(+), 126 deletions(-) diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart index 3bb4e0d..26bd8f4 100644 --- a/lib/app/modules/home/views/home_view.dart +++ b/lib/app/modules/home/views/home_view.dart @@ -100,14 +100,12 @@ class HomeView extends GetView { ), controller.prompt.value ? Container() - : Obx( - () => Positioned( - right: 49.w, - top: 50.h, - child: ExploreWidget( - explored: controller.explored.value, - exploreCount: controller.exploreCount.value, - ), + : Positioned( + right: 49.w, + top: 50.h, + child: ExploreWidget( + explored: controller.explored.value, + exploreCount: controller.exploreCount.value, ), ), controller.prompt.value @@ -157,48 +155,42 @@ class HomeView extends GetView { Widget goalWidget() { return Stack( children: [ - Obx( - () => controller.explored.value - ? Positioned( - left: 15.w, - top: 20.h, - child: Container( - height: 311.h, - width: 230.w, - color: Colors.transparent, - child: fourthGoalWidget(), - ), - ) - : Container(), - ), - Obx( - () => controller.explored.value - ? Positioned( - left: 352.w, - top: 0.0, - child: Container( - height: 221.h, - width: 281.w, - color: Colors.transparent, - child: thirdGoalWidget(), - ), - ) - : Container(), - ), - Obx( - () => controller.explored.value - ? Positioned( - left: 363.w, - top: 180.h, - child: Container( - height: 240.h, - width: 240.w, - color: Colors.transparent, - child: secondGoalWidget(), - ), - ) - : Container(), - ), + controller.explored.value + ? Positioned( + left: 15.w, + top: 20.h, + child: Container( + height: 311.h, + width: 230.w, + color: Colors.transparent, + child: fourthGoalWidget(), + ), + ) + : Container(), + controller.explored.value + ? Positioned( + left: 352.w, + top: 0.0, + child: Container( + height: 221.h, + width: 281.w, + color: Colors.transparent, + child: thirdGoalWidget(), + ), + ) + : Container(), + controller.explored.value + ? Positioned( + left: 363.w, + top: 180.h, + child: Container( + height: 240.h, + width: 240.w, + color: Colors.transparent, + child: secondGoalWidget(), + ), + ) + : Container(), ], ); } @@ -447,60 +439,54 @@ class HomeView extends GetView { ), ), ), - Obx( - () => controller.explored.value - ? Positioned( - left: 15.w, - top: 20.h, - child: Container( - height: 311.h, - width: 230.w, - decoration: const BoxDecoration( - image: DecorationImage( - image: Images.homeFourthLeaf, - fit: BoxFit.fill, - ), + controller.explored.value + ? Positioned( + left: 15.w, + top: 20.h, + child: Container( + height: 311.h, + width: 230.w, + decoration: const BoxDecoration( + image: DecorationImage( + image: Images.homeFourthLeaf, + fit: BoxFit.fill, ), ), - ) - : Container(), - ), - Obx( - () => controller.explored.value - ? Positioned( - left: 352.w, - top: 0.0, - child: Container( - height: 221.h, - width: 281.w, - decoration: const BoxDecoration( - image: DecorationImage( - image: Images.homeThirdLeaf, - fit: BoxFit.fill, - ), + ), + ) + : Container(), + controller.explored.value + ? Positioned( + left: 352.w, + top: 0.0, + child: Container( + height: 221.h, + width: 281.w, + decoration: const BoxDecoration( + image: DecorationImage( + image: Images.homeThirdLeaf, + fit: BoxFit.fill, ), ), - ) - : Container(), - ), - Obx( - () => controller.explored.value - ? Positioned( - left: 363.w, - top: 180.h, - child: Container( - height: 240.h, - width: 240.w, - decoration: const BoxDecoration( - image: DecorationImage( - image: Images.homeSecondLeaf, - fit: BoxFit.fill, - ), + ), + ) + : Container(), + controller.explored.value + ? Positioned( + left: 363.w, + top: 180.h, + child: Container( + height: 240.h, + width: 240.w, + decoration: const BoxDecoration( + image: DecorationImage( + image: Images.homeSecondLeaf, + fit: BoxFit.fill, ), ), - ) - : Container(), - ), + ), + ) + : Container(), controller.prompt.value ? Container() : firstLeafWidget(), Positioned( left: 168.w, @@ -571,11 +557,9 @@ class HomeView extends GetView { Positioned( left: 23.w, top: 26.h, - child: Obx( - () => Text( - '本月已点亮${controller.exploreCount.value}个知识点', - style: TextStyles.mediumWhiteShadow12_111, - ), + child: Text( + '本月已点亮${controller.exploreCount.value}个知识点', + style: TextStyles.mediumWhiteShadow12_111, ), ), ], @@ -616,29 +600,25 @@ class HomeView extends GetView { } Widget exploreAppWidget(ExploreApp app) { - return Obx( - () => GestureDetector( - onTap: () { - if (controller.explored.value) {} - }, - child: Obx( - () => Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - LoadAssetImage( - 'home/${controller.explored.value ? app.icon : app.grayIcon}', - height: 74.w, - width: 74.w, - fit: BoxFit.fill, - ), - const RSizedBox(height: 2), - Text( - app.name!, - style: TextStyles.boldWhite16, - ) - ], + return GestureDetector( + onTap: () { + if (controller.explored.value) {} + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + LoadAssetImage( + 'home/${controller.explored.value ? app.icon : app.grayIcon}', + height: 74.w, + width: 74.w, + fit: BoxFit.fill, ), - ), + const RSizedBox(height: 2), + Text( + app.name!, + style: TextStyles.boldWhite16, + ) + ], ), ); } diff --git a/lib/app/routes/app_pages.dart b/lib/app/routes/app_pages.dart index 797a4fa..f564200 100644 --- a/lib/app/routes/app_pages.dart +++ b/lib/app/routes/app_pages.dart @@ -20,7 +20,7 @@ part 'app_routes.dart'; class AppPages { AppPages._(); - static const INITIAL = Routes.SPLASH; + static const INITIAL = Routes.HOME; static final routes = [ GetPage(