关怀模式
This commit is contained in:
@@ -46,20 +46,23 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(value ? '已加入用户体验计划' : '已退出用户体验计划'),
|
||||
backgroundColor: value ? AppConstants.primaryColor : Colors.grey[600],
|
||||
backgroundColor: value
|
||||
? _themeController.currentThemeColor
|
||||
: Colors.grey[600],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void _showJoinDialog() {
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
title: Row(
|
||||
children: [
|
||||
Icon(Icons.volunteer_activism, color: AppConstants.primaryColor),
|
||||
Icon(Icons.volunteer_activism, color: primaryColor),
|
||||
const SizedBox(width: 8),
|
||||
const Text('加入用户体验计划'),
|
||||
],
|
||||
@@ -96,7 +99,7 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
_toggleUserPlan(true);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppConstants.primaryColor,
|
||||
backgroundColor: primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@@ -110,13 +113,14 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
}
|
||||
|
||||
void _showInfoPopup(BuildContext context) {
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
title: Row(
|
||||
children: [
|
||||
Icon(Icons.info, color: AppConstants.primaryColor),
|
||||
Icon(Icons.info, color: primaryColor),
|
||||
const SizedBox(width: 8),
|
||||
const Text('温馨提示'),
|
||||
],
|
||||
@@ -192,6 +196,7 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(() {
|
||||
final isDark = _themeController.isDarkMode;
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
return Scaffold(
|
||||
backgroundColor: isDark
|
||||
? const Color(0xFF1A1A1A)
|
||||
@@ -199,16 +204,13 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
'用户体验计划',
|
||||
style: TextStyle(
|
||||
color: AppConstants.primaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
style: TextStyle(color: primaryColor, fontWeight: FontWeight.bold),
|
||||
),
|
||||
backgroundColor: isDark ? const Color(0xFF2A2A2A) : Colors.white,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back, color: AppConstants.primaryColor),
|
||||
icon: Icon(Icons.arrow_back, color: primaryColor),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
@@ -235,21 +237,19 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
}
|
||||
|
||||
Widget _buildStatusCard(bool isDark) {
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppConstants.primaryColor,
|
||||
AppConstants.primaryColor.withBlue(180),
|
||||
],
|
||||
colors: [primaryColor, primaryColor.withBlue(180)],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppConstants.primaryColor.withValues(alpha: 0.3),
|
||||
color: primaryColor.withAlpha(30),
|
||||
blurRadius: 12,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
@@ -531,6 +531,7 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
itemCount: benefits.length,
|
||||
itemBuilder: (context, index) {
|
||||
final benefit = benefits[index];
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
@@ -539,7 +540,7 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
border: Border.all(
|
||||
color: isDark
|
||||
? Colors.grey[700]!
|
||||
: Colors.grey.withValues(alpha: 0.2),
|
||||
: Colors.grey.withAlpha(20),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
@@ -547,7 +548,7 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
Icon(
|
||||
benefit['icon'] as IconData,
|
||||
size: 18,
|
||||
color: AppConstants.primaryColor,
|
||||
color: primaryColor,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
@@ -660,6 +661,7 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
}
|
||||
|
||||
Widget _buildActionButton(bool isDark) {
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
@@ -667,10 +669,7 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
gradient: _isJoined
|
||||
? null
|
||||
: LinearGradient(
|
||||
colors: [
|
||||
AppConstants.primaryColor,
|
||||
AppConstants.primaryColor.withBlue(180),
|
||||
],
|
||||
colors: [primaryColor, primaryColor.withBlue(180)],
|
||||
),
|
||||
color: _isJoined
|
||||
? (isDark ? Colors.grey[700] : Colors.grey[300])
|
||||
@@ -680,7 +679,7 @@ class _UserPlanPageState extends State<UserPlanPage> {
|
||||
? null
|
||||
: [
|
||||
BoxShadow(
|
||||
color: AppConstants.primaryColor.withValues(alpha: 0.3),
|
||||
color: primaryColor.withAlpha(30),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user