修正显示问题

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
? 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<HomeController> {
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<HomeController> {
),
),
),
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<HomeController> {
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<HomeController> {
}
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,
)
],
),
);
}

View File

@ -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(