关怀模式

This commit is contained in:
Developer
2026-04-02 22:30:49 +08:00
parent 09fee0694c
commit 7872f2e78a
70 changed files with 4884 additions and 2752 deletions

View File

@@ -19,6 +19,7 @@ class CategoryPage extends StatelessWidget {
return Obx(() {
final isDark = themeController.isDarkModeRx.value;
final themeColor = themeController.currentThemeColor;
return Column(
children: [
@@ -41,11 +42,11 @@ class CategoryPage extends StatelessWidget {
),
)
.toList(),
labelColor: AppConstants.primaryColor,
labelColor: themeColor,
unselectedLabelColor: isDark
? Colors.grey[400]
: Colors.grey[600],
indicatorColor: AppConstants.primaryColor,
indicatorColor: themeColor,
indicatorWeight: 3,
labelStyle: const TextStyle(
fontWeight: FontWeight.w600,
@@ -71,11 +72,13 @@ class CategoryPage extends StatelessWidget {
controller.sceneData,
controller.tabCategories[0]['label'] as String,
isDark,
themeColor,
),
_buildCategoryList(
controller.dynastyData,
controller.tabCategories[1]['label'] as String,
isDark,
themeColor,
),
],
),
@@ -90,6 +93,7 @@ class CategoryPage extends StatelessWidget {
Map<String, List<String>> data,
String categoryType,
bool isDark,
Color themeColor,
) {
return ListView.separated(
padding: const EdgeInsets.symmetric(vertical: 8),
@@ -138,14 +142,14 @@ class CategoryPage extends StatelessWidget {
vertical: 4,
),
decoration: BoxDecoration(
color: AppConstants.primaryColor.withAlpha(26),
color: themeColor.withAlpha(26),
borderRadius: BorderRadius.circular(12),
),
child: Text(
'${items.length}',
style: TextStyle(
fontSize: 13,
color: AppConstants.primaryColor,
color: themeColor,
fontWeight: FontWeight.w600,
),
),
@@ -157,7 +161,12 @@ class CategoryPage extends StatelessWidget {
spacing: 10,
runSpacing: 10,
children: items.map((item) {
return _buildCategoryChip(item, categoryType, isDark);
return _buildCategoryChip(
item,
categoryType,
isDark,
themeColor,
);
}).toList(),
),
],
@@ -169,7 +178,12 @@ class CategoryPage extends StatelessWidget {
);
}
Widget _buildCategoryChip(String label, String categoryType, bool isDark) {
Widget _buildCategoryChip(
String label,
String categoryType,
bool isDark,
Color themeColor,
) {
final controller = Get.find<CategoryController>();
return GestureDetector(
@@ -179,17 +193,14 @@ class CategoryPage extends StatelessWidget {
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
decoration: BoxDecoration(
color: AppConstants.primaryColor.withAlpha(26),
color: themeColor.withAlpha(26),
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: AppConstants.primaryColor.withAlpha(77),
width: 1,
),
border: Border.all(color: themeColor.withAlpha(77), width: 1),
),
child: Text(
label,
style: TextStyle(
color: AppConstants.primaryColor,
color: themeColor,
fontSize: 14,
fontWeight: FontWeight.w500,
),