关怀模式
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../utils/responsive_layout.dart';
|
||||
import '../widgets/responsive_widgets.dart';
|
||||
import '../constants/app_constants.dart';
|
||||
import '../services/get/theme_controller.dart';
|
||||
|
||||
class ResponsiveHomePage extends StatefulWidget {
|
||||
const ResponsiveHomePage({super.key});
|
||||
@@ -12,6 +14,7 @@ class ResponsiveHomePage extends StatefulWidget {
|
||||
|
||||
class _ResponsiveHomePageState extends State<ResponsiveHomePage> {
|
||||
String _layoutMode = AppConstants.gridLayout;
|
||||
final ThemeController _themeController = Get.find<ThemeController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -64,18 +67,18 @@ class _ResponsiveHomePageState extends State<ResponsiveHomePage> {
|
||||
text: '网格布局',
|
||||
onPressed: () => _changeLayout(AppConstants.gridLayout),
|
||||
backgroundColor: _layoutMode == AppConstants.gridLayout
|
||||
? AppConstants.primaryColor
|
||||
: Colors.grey[300],
|
||||
textColor: _layoutMode == AppConstants.gridLayout
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
? _themeController.currentThemeColor
|
||||
: Colors.grey[300],
|
||||
textColor: _layoutMode == AppConstants.gridLayout
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
ResponsiveButton(
|
||||
text: '列表布局',
|
||||
onPressed: () => _changeLayout(AppConstants.listLayout),
|
||||
backgroundColor: _layoutMode == AppConstants.listLayout
|
||||
? AppConstants.primaryColor
|
||||
? _themeController.currentThemeColor
|
||||
: Colors.grey[300],
|
||||
textColor: _layoutMode == AppConstants.listLayout
|
||||
? Colors.white
|
||||
@@ -133,13 +136,13 @@ class _ResponsiveHomePageState extends State<ResponsiveHomePage> {
|
||||
width: double.infinity,
|
||||
height: ResponsiveLayout.isMobile(context) ? 80 : 120,
|
||||
decoration: BoxDecoration(
|
||||
color: AppConstants.primaryColor.withValues(alpha: 0.1),
|
||||
color: _themeController.currentThemeColor.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.widgets,
|
||||
size: ResponsiveLayout.isMobile(context) ? 32 : 48,
|
||||
color: AppConstants.primaryColor,
|
||||
color: _themeController.currentThemeColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
@@ -172,13 +175,13 @@ class _ResponsiveHomePageState extends State<ResponsiveHomePage> {
|
||||
width: ResponsiveLayout.isMobile(context) ? 60 : 80,
|
||||
height: ResponsiveLayout.isMobile(context) ? 60 : 80,
|
||||
decoration: BoxDecoration(
|
||||
color: AppConstants.primaryColor.withValues(alpha: 0.1),
|
||||
color: _themeController.currentThemeColor.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.widgets,
|
||||
size: ResponsiveLayout.isMobile(context) ? 24 : 32,
|
||||
color: AppConstants.primaryColor,
|
||||
color: _themeController.currentThemeColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
|
||||
Reference in New Issue
Block a user