关怀模式

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

@@ -5,6 +5,8 @@ import 'package:flutter/services.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:get/get.dart';
import '../../constants/app_constants.dart';
import '../../models/colors/theme_colors.dart';
import '../../services/get/theme_controller.dart';
import '../../services/network_listener_service.dart';
import 'guide/tongji.dart';
@@ -43,6 +45,7 @@ class PersonalCardState extends State<PersonalCard> {
bool _isUserPlanJoined = false;
late TextEditingController _nicknameController;
int _currentAvatarIndex = 0;
final ThemeController _themeController = Get.find<ThemeController>();
// 累计数据
int _totalViews = 0;
@@ -284,6 +287,7 @@ class PersonalCardState extends State<PersonalCard> {
@override
Widget build(BuildContext context) {
final primaryColor = _themeController.currentThemeColor;
return Container(
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
decoration: BoxDecoration(
@@ -302,8 +306,8 @@ class PersonalCardState extends State<PersonalCard> {
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
AppConstants.primaryColor.withOpacity(0.95),
AppConstants.primaryColor.withOpacity(0.85),
primaryColor.withOpacity(0.95),
primaryColor.withOpacity(0.85),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
@@ -327,7 +331,7 @@ class PersonalCardState extends State<PersonalCard> {
),
// 内容层
_isExpanded
? _buildExpandedContent()
? _buildExpandedContent(primaryColor)
: _buildCollapsedContent(),
],
),
@@ -453,7 +457,7 @@ class PersonalCardState extends State<PersonalCard> {
);
}
Widget _buildExpandedContent() {
Widget _buildExpandedContent(Color primaryColor) {
return Column(
children: [
// 头部信息
@@ -520,18 +524,18 @@ class PersonalCardState extends State<PersonalCard> {
child: _isEditingNickname
? TextField(
controller: _nicknameController,
style: const TextStyle(
color: AppConstants.primaryColor,
style: TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.bold,
),
decoration: const InputDecoration(
decoration: InputDecoration(
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: '输入昵称',
hintStyle: TextStyle(
color: AppConstants.primaryColor,
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.bold,
),
@@ -682,8 +686,8 @@ class PersonalCardState extends State<PersonalCard> {
Expanded(
child: Text(
'💡 $_currentTip',
style: const TextStyle(
color: AppConstants.primaryColor,
style: TextStyle(
color: primaryColor,
fontSize: 14,
fontWeight: FontWeight.w600,
height: 1.3,
@@ -698,7 +702,7 @@ class PersonalCardState extends State<PersonalCard> {
onChanged: (value) {
_toggleOnlineStatus();
},
activeColor: AppConstants.primaryColor,
activeColor: primaryColor,
inactiveTrackColor: Colors.grey.shade300,
inactiveThumbColor: Colors.grey,
),