修正显示问题

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,14 +100,12 @@ 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( explored: controller.explored.value,
explored: controller.explored.value, exploreCount: controller.exploreCount.value,
exploreCount: controller.exploreCount.value,
),
), ),
), ),
controller.prompt.value controller.prompt.value
@ -157,48 +155,42 @@ 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, child: Container(
child: Container( height: 311.h,
height: 311.h, width: 230.w,
width: 230.w, color: Colors.transparent,
color: Colors.transparent, child: fourthGoalWidget(),
child: fourthGoalWidget(), ),
), )
) : Container(),
: Container(), controller.explored.value
), ? Positioned(
Obx( left: 352.w,
() => controller.explored.value top: 0.0,
? Positioned( child: Container(
left: 352.w, height: 221.h,
top: 0.0, width: 281.w,
child: Container( color: Colors.transparent,
height: 221.h, child: thirdGoalWidget(),
width: 281.w, ),
color: Colors.transparent, )
child: thirdGoalWidget(), : Container(),
), controller.explored.value
) ? Positioned(
: Container(), left: 363.w,
), top: 180.h,
Obx( child: Container(
() => controller.explored.value height: 240.h,
? Positioned( width: 240.w,
left: 363.w, color: Colors.transparent,
top: 180.h, child: secondGoalWidget(),
child: Container( ),
height: 240.h, )
width: 240.w, : Container(),
color: Colors.transparent,
child: secondGoalWidget(),
),
)
: Container(),
),
], ],
); );
} }
@ -447,60 +439,54 @@ 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, child: Container(
child: Container( height: 311.h,
height: 311.h, width: 230.w,
width: 230.w, decoration: const BoxDecoration(
decoration: const BoxDecoration( image: DecorationImage(
image: DecorationImage( image: Images.homeFourthLeaf,
image: Images.homeFourthLeaf, fit: BoxFit.fill,
fit: BoxFit.fill,
),
), ),
), ),
) ),
: Container(), )
), : Container(),
Obx( controller.explored.value
() => controller.explored.value ? Positioned(
? Positioned( left: 352.w,
left: 352.w, top: 0.0,
top: 0.0, child: Container(
child: Container( height: 221.h,
height: 221.h, width: 281.w,
width: 281.w, decoration: const BoxDecoration(
decoration: const BoxDecoration( image: DecorationImage(
image: DecorationImage( image: Images.homeThirdLeaf,
image: Images.homeThirdLeaf, fit: BoxFit.fill,
fit: BoxFit.fill,
),
), ),
), ),
) ),
: Container(), )
), : Container(),
Obx( controller.explored.value
() => controller.explored.value ? Positioned(
? Positioned( left: 363.w,
left: 363.w, top: 180.h,
top: 180.h, child: Container(
child: Container( height: 240.h,
height: 240.h, width: 240.w,
width: 240.w, decoration: const BoxDecoration(
decoration: const BoxDecoration( image: DecorationImage(
image: DecorationImage( image: Images.homeSecondLeaf,
image: Images.homeSecondLeaf, fit: BoxFit.fill,
fit: BoxFit.fill,
),
), ),
), ),
) ),
: Container(), )
), : Container(),
controller.prompt.value ? Container() : firstLeafWidget(), controller.prompt.value ? Container() : firstLeafWidget(),
Positioned( Positioned(
left: 168.w, left: 168.w,
@ -571,11 +557,9 @@ 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,29 +600,25 @@ 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: Column(
child: Obx( crossAxisAlignment: CrossAxisAlignment.center,
() => Column( children: [
crossAxisAlignment: CrossAxisAlignment.center, LoadAssetImage(
children: [ 'home/${controller.explored.value ? app.icon : app.grayIcon}',
LoadAssetImage( height: 74.w,
'home/${controller.explored.value ? app.icon : app.grayIcon}', width: 74.w,
height: 74.w, fit: BoxFit.fill,
width: 74.w,
fit: BoxFit.fill,
),
const RSizedBox(height: 2),
Text(
app.name!,
style: TextStyles.boldWhite16,
)
],
), ),
), const RSizedBox(height: 2),
Text(
app.name!,
style: TextStyles.boldWhite16,
)
],
), ),
); );
} }

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(