修正显示问题

This commit is contained in:
tanghong668 2023-11-28 17:57:36 +08:00
parent 10e99e64d5
commit f1c7279bfb
2 changed files with 106 additions and 126 deletions

View File

@ -100,8 +100,7 @@ class HomeView extends GetView<HomeController> {
), ),
controller.prompt.value controller.prompt.value
? Container() ? Container()
: Obx( : Positioned(
() => Positioned(
right: 49.w, right: 49.w,
top: 50.h, top: 50.h,
child: ExploreWidget( child: ExploreWidget(
@ -109,7 +108,6 @@ class HomeView extends GetView<HomeController> {
exploreCount: controller.exploreCount.value, exploreCount: controller.exploreCount.value,
), ),
), ),
),
controller.prompt.value controller.prompt.value
? Container() ? Container()
: Positioned( : Positioned(
@ -157,8 +155,7 @@ class HomeView extends GetView<HomeController> {
Widget goalWidget() { Widget goalWidget() {
return Stack( return Stack(
children: [ children: [
Obx( controller.explored.value
() => controller.explored.value
? Positioned( ? Positioned(
left: 15.w, left: 15.w,
top: 20.h, top: 20.h,
@ -170,9 +167,7 @@ class HomeView extends GetView<HomeController> {
), ),
) )
: Container(), : Container(),
), controller.explored.value
Obx(
() => controller.explored.value
? Positioned( ? Positioned(
left: 352.w, left: 352.w,
top: 0.0, top: 0.0,
@ -184,9 +179,7 @@ class HomeView extends GetView<HomeController> {
), ),
) )
: Container(), : Container(),
), controller.explored.value
Obx(
() => controller.explored.value
? Positioned( ? Positioned(
left: 363.w, left: 363.w,
top: 180.h, top: 180.h,
@ -198,7 +191,6 @@ class HomeView extends GetView<HomeController> {
), ),
) )
: Container(), : Container(),
),
], ],
); );
} }
@ -447,8 +439,7 @@ class HomeView extends GetView<HomeController> {
), ),
), ),
), ),
Obx( controller.explored.value
() => controller.explored.value
? Positioned( ? Positioned(
left: 15.w, left: 15.w,
top: 20.h, top: 20.h,
@ -464,9 +455,7 @@ class HomeView extends GetView<HomeController> {
), ),
) )
: Container(), : Container(),
), controller.explored.value
Obx(
() => controller.explored.value
? Positioned( ? Positioned(
left: 352.w, left: 352.w,
top: 0.0, top: 0.0,
@ -482,9 +471,7 @@ class HomeView extends GetView<HomeController> {
), ),
) )
: Container(), : Container(),
), controller.explored.value
Obx(
() => controller.explored.value
? Positioned( ? Positioned(
left: 363.w, left: 363.w,
top: 180.h, top: 180.h,
@ -500,7 +487,6 @@ class HomeView extends GetView<HomeController> {
), ),
) )
: Container(), : Container(),
),
controller.prompt.value ? Container() : firstLeafWidget(), controller.prompt.value ? Container() : firstLeafWidget(),
Positioned( Positioned(
left: 168.w, left: 168.w,
@ -571,13 +557,11 @@ class HomeView extends GetView<HomeController> {
Positioned( Positioned(
left: 23.w, left: 23.w,
top: 26.h, top: 26.h,
child: Obx( child: Text(
() => Text(
'本月已点亮${controller.exploreCount.value}个知识点', '本月已点亮${controller.exploreCount.value}个知识点',
style: TextStyles.mediumWhiteShadow12_111, style: TextStyles.mediumWhiteShadow12_111,
), ),
), ),
),
], ],
), ),
), ),
@ -616,13 +600,11 @@ class HomeView extends GetView<HomeController> {
} }
Widget exploreAppWidget(ExploreApp app) { Widget exploreAppWidget(ExploreApp app) {
return Obx( return GestureDetector(
() => GestureDetector(
onTap: () { onTap: () {
if (controller.explored.value) {} if (controller.explored.value) {}
}, },
child: Obx( child: Column(
() => Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
LoadAssetImage( LoadAssetImage(
@ -638,8 +620,6 @@ class HomeView extends GetView<HomeController> {
) )
], ],
), ),
),
),
); );
} }
} }

View File

@ -20,7 +20,7 @@ part 'app_routes.dart';
class AppPages { class AppPages {
AppPages._(); AppPages._();
static const INITIAL = Routes.SPLASH; static const INITIAL = Routes.HOME;
static final routes = [ static final routes = [
GetPage( GetPage(