diff --git a/assets/images/home/btn_bg_grey.png b/assets/images/home/btn_bg_grey.png new file mode 100644 index 0000000..151503b Binary files /dev/null and b/assets/images/home/btn_bg_grey.png differ diff --git a/assets/images/home/btn_bg_music.png b/assets/images/home/btn_bg_music.png new file mode 100644 index 0000000..0907ea8 Binary files /dev/null and b/assets/images/home/btn_bg_music.png differ diff --git a/assets/images/home/btn_bg_picture_book.png b/assets/images/home/btn_bg_picture_book.png new file mode 100644 index 0000000..7adb45f Binary files /dev/null and b/assets/images/home/btn_bg_picture_book.png differ diff --git a/assets/images/home/btn_bg_programme.png b/assets/images/home/btn_bg_programme.png new file mode 100644 index 0000000..4880c82 Binary files /dev/null and b/assets/images/home/btn_bg_programme.png differ diff --git a/assets/images/home/btn_icon_music.png b/assets/images/home/btn_icon_music.png index 4d40367..b0d9283 100644 Binary files a/assets/images/home/btn_icon_music.png and b/assets/images/home/btn_icon_music.png differ diff --git a/assets/images/home/btn_icon_music_grey.png b/assets/images/home/btn_icon_music_grey.png index fdd2ad4..ea94bd5 100644 Binary files a/assets/images/home/btn_icon_music_grey.png and b/assets/images/home/btn_icon_music_grey.png differ diff --git a/assets/images/home/btn_icon_picture_book.png b/assets/images/home/btn_icon_picture_book.png index 2f66e06..b22d7d4 100644 Binary files a/assets/images/home/btn_icon_picture_book.png and b/assets/images/home/btn_icon_picture_book.png differ diff --git a/assets/images/home/btn_icon_picture_book_grey.png b/assets/images/home/btn_icon_picture_book_grey.png index a9e9977..99dcc32 100644 Binary files a/assets/images/home/btn_icon_picture_book_grey.png and b/assets/images/home/btn_icon_picture_book_grey.png differ diff --git a/assets/images/home/btn_icon_programme.png b/assets/images/home/btn_icon_programme.png index 7de2d8f..7e6a540 100644 Binary files a/assets/images/home/btn_icon_programme.png and b/assets/images/home/btn_icon_programme.png differ diff --git a/assets/images/home/btn_icon_programme_grey.png b/assets/images/home/btn_icon_programme_grey.png index 52ea6e7..71464a5 100644 Binary files a/assets/images/home/btn_icon_programme_grey.png and b/assets/images/home/btn_icon_programme_grey.png differ diff --git a/lib/app/modules/home/controllers/home_controller.dart b/lib/app/modules/home/controllers/home_controller.dart index 174b3f7..9c4e3a7 100644 --- a/lib/app/modules/home/controllers/home_controller.dart +++ b/lib/app/modules/home/controllers/home_controller.dart @@ -23,11 +23,11 @@ class HomeController extends GetxController { HomeController({required this.homeProvider}); - final explored = true.obs; + final explored = false.obs; final explored2 = 0.obs; final create = true.obs; final prompt = false.obs; - final exploreCount = 2.obs; + final exploreCount = 0.obs; final exploreDay = 1.obs; final chatMsgList = RxList([]); final selectKnowledge = Rx(null); diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart index 75d8748..7d1e2bb 100644 --- a/lib/app/modules/home/views/home_view.dart +++ b/lib/app/modules/home/views/home_view.dart @@ -1,5 +1,6 @@ import 'package:dreampad/app/models/models.dart'; import 'package:dreampad/app/routes/app_pages.dart'; +import 'package:dreampad/app/shared/constants/dimens.dart'; import 'package:dreampad/app/shared/shared.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; @@ -527,9 +528,19 @@ class HomeView extends GetView { bottom: 10.h, child: GestureDetector( onTap: () {}, - child: controller.explored.value - ? Images.homePicturebook - : Images.homePicturebookGrey, + child: buildMainApp( + '智慧编程', + Images.homeMainAppProgramme, + Images.homeProgramme, + Images.homeProgrammeGrey, + TextStyle( + fontSize: Dimens.font_sp10.sp, + fontFamily: 'alph-b', + color: const Color(0xFFFFBC5A), + fontWeight: FontWeight.bold, + ), + controller.explored.value, + ), ), ), Positioned( @@ -537,9 +548,19 @@ class HomeView extends GetView { bottom: 10.h, child: GestureDetector( onTap: () {}, - child: controller.explored.value - ? Images.homeProgramme - : Images.homeProgrammeGrey, + child: buildMainApp( + '绘本创作', + Images.homeMainAppPictureBook, + Images.homePicturebook, + Images.homePicturebookGrey, + TextStyle( + fontSize: Dimens.font_sp10.sp, + fontFamily: 'alph-b', + color: const Color(0xFF68FFFA), + fontWeight: FontWeight.bold, + ), + controller.explored.value, + ), ), ), Positioned( @@ -547,9 +568,19 @@ class HomeView extends GetView { bottom: 10.h, child: GestureDetector( onTap: () {}, - child: controller.explored.value - ? Images.homeMusic - : Images.homeMusicGrey, + child: buildMainApp( + '乐曲创作', + Images.homeMainAppMusic, + Images.homeMusic, + Images.homeMusicGrey, + TextStyle( + fontSize: Dimens.font_sp10.sp, + fontFamily: 'alph-b', + color: const Color(0xFFEA74DF), + fontWeight: FontWeight.bold, + ), + controller.explored.value, + ), ), ), ], @@ -557,6 +588,37 @@ class HomeView extends GetView { ); } + Widget buildMainApp( + String name, + AssetImage bgImage, + Widget appIco, + Widget appGreyIco, + TextStyle textStyle, + bool usable, + ) { + return Container( + height: 90.w, + width: 90.w, + decoration: BoxDecoration( + image: DecorationImage( + image: usable ? bgImage : Images.homeMainAppGrey, + fit: BoxFit.fill, + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + usable ? appIco : appGreyIco, + Text( + name, + style: usable ? textStyle : TextStyles.boldColor10, + ) + ], + ), + ); + } + void showGoalDialog(Goal goal) { SmartDialog.show( maskColor: const Color(0xFF02184B).withOpacity(0.7), diff --git a/lib/app/shared/constants/images.dart b/lib/app/shared/constants/images.dart index 4f27e6b..50f1595 100644 --- a/lib/app/shared/constants/images.dart +++ b/lib/app/shared/constants/images.dart @@ -135,38 +135,38 @@ class Images { static Widget homePicturebook = LoadAssetImage( 'home/btn_icon_picture_book', - height: 90.w, - width: 90.w, + height: 41.w, + width: 41.w, ); static Widget homePicturebookGrey = LoadAssetImage( 'home/btn_icon_picture_book_grey', - height: 90.w, - width: 90.w, + height: 41.w, + width: 41.w, ); static Widget homeProgramme = LoadAssetImage( 'home/btn_icon_programme', - height: 90.w, - width: 90.w, + height: 41.w, + width: 41.w, ); static Widget homeProgrammeGrey = LoadAssetImage( 'home/btn_icon_programme_grey', - height: 90.w, - width: 90.w, + height: 41.w, + width: 41.w, ); static Widget homeMusic = LoadAssetImage( 'home/btn_icon_music', - height: 90.w, - width: 90.w, + height: 41.w, + width: 41.w, ); static Widget homeMusicGrey = LoadAssetImage( 'home/btn_icon_music_grey', - height: 90.w, - width: 90.w, + height: 41.w, + width: 41.w, ); static Widget homeIp = LoadAssetImage( @@ -283,6 +283,14 @@ class Images { AssetImage("assets/images/home/bg_pic_windows.png"); static const AssetImage homeLantern = AssetImage("assets/images/home/label_icon_lantern.png"); + static const AssetImage homeMainAppProgramme = + AssetImage("assets/images/home/btn_bg_programme.png"); + static const AssetImage homeMainAppPictureBook = + AssetImage("assets/images/home/btn_bg_picture_book.png"); + static const AssetImage homeMainAppMusic = + AssetImage("assets/images/home/btn_bg_music.png"); + static const AssetImage homeMainAppGrey = + AssetImage("assets/images/home/btn_bg_grey.png"); static const AssetImage studyBg = AssetImage("assets/images/study/bg_pic_dream_exploration_page.png"); diff --git a/lib/app/shared/constants/styles.dart b/lib/app/shared/constants/styles.dart index e831795..a6ab26b 100644 --- a/lib/app/shared/constants/styles.dart +++ b/lib/app/shared/constants/styles.dart @@ -355,6 +355,12 @@ class TextStyles { color: Colors.white, fontWeight: FontWeight.bold, ); + static TextStyle boldColor10 = TextStyle( + fontSize: Dimens.font_sp10.sp, + fontFamily: 'alph-b', + color: const Color(0xFFAAAAAA), + fontWeight: FontWeight.bold, + ); static TextStyle boldColor24 = TextStyle( fontSize: Dimens.font_sp24.sp,