关怀模式

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

@@ -198,6 +198,8 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
// 显示密码设置对话框
Future<void> _showPasswordDialog() async {
final themeColor = _themeController.currentThemeColor;
final isDark = _themeController.isDarkMode;
if (_password != null && _password!.isNotEmpty) {
final action = await showDialog<String>(
context: context,
@@ -207,7 +209,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
),
title: Row(
children: [
Icon(Icons.lock, color: AppConstants.primaryColor, size: 24),
Icon(Icons.lock, color: themeColor, size: 24),
const SizedBox(width: 8),
const Text('锁定设置'),
],
@@ -218,18 +220,22 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.grey[100],
color: isDark ? Colors.grey[800] : Colors.grey[100],
borderRadius: BorderRadius.circular(8),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.vpn_key, size: 16, color: Colors.grey[600]),
Icon(
Icons.vpn_key,
size: 16,
color: isDark ? Colors.grey[400] : Colors.grey[600],
),
const SizedBox(width: 8),
Text(
'当前密码: $_password',
style: TextStyle(
color: Colors.grey[700],
color: isDark ? Colors.grey[400] : Colors.grey[700],
fontSize: 13,
fontWeight: FontWeight.w500,
),
@@ -282,25 +288,21 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
horizontal: 16,
),
decoration: BoxDecoration(
color: AppConstants.primaryColor.withValues(alpha: 0.1),
color: themeColor.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: AppConstants.primaryColor.withValues(alpha: 0.3),
color: themeColor.withValues(alpha: 0.3),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.edit,
color: AppConstants.primaryColor,
size: 22,
),
Icon(Icons.edit, color: themeColor, size: 22),
const SizedBox(width: 10),
Text(
'修改密码',
style: TextStyle(
color: AppConstants.primaryColor,
color: themeColor,
fontSize: 15,
fontWeight: FontWeight.w600,
),
@@ -555,6 +557,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
Widget build(BuildContext context) {
return Obx(() {
final isDark = _themeController.isDarkMode;
final themeColor = _themeController.currentThemeColor;
return Scaffold(
backgroundColor: isDark
? const Color(0xFF1A1A1A)
@@ -565,7 +568,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
leading: IconButton(
icon: Icon(
Icons.arrow_back,
color: isDark ? Colors.white70 : AppConstants.primaryColor,
color: isDark ? Colors.white70 : themeColor,
),
onPressed: () => Navigator.of(context).pop(),
),
@@ -590,7 +593,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
icon: Icon(
_isLocked ? Icons.lock : Icons.lock_outline,
color: _isLocked
? AppConstants.primaryColor
? themeColor
: (isDark ? Colors.grey[400] : Colors.grey[600]),
),
onPressed: _showPasswordDialog,
@@ -600,7 +603,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
icon: Icon(
_isPinned ? Icons.push_pin : Icons.push_pin_outlined,
color: _isPinned
? AppConstants.primaryColor
? themeColor
: (isDark ? Colors.grey[400] : Colors.grey[600]),
),
onPressed: _togglePin,
@@ -611,7 +614,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
body: _isLoading
? Center(
child: CircularProgressIndicator(
color: isDark ? Colors.white : AppConstants.primaryColor,
color: isDark ? Colors.white : themeColor,
),
)
: GestureDetector(
@@ -621,7 +624,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
},
child: Column(
children: [
_buildStatusBar(isDark),
_buildStatusBar(isDark, themeColor),
Expanded(
child: SingleChildScrollView(
padding: const EdgeInsets.all(16),
@@ -629,9 +632,9 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
_buildTitleInput(isDark),
_buildTitleInput(isDark, themeColor),
const SizedBox(height: 16),
_buildContentInput(isDark),
_buildContentInput(isDark, themeColor),
],
),
),
@@ -643,7 +646,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
});
}
Widget _buildStatusBar(bool isDark) {
Widget _buildStatusBar(bool isDark, Color themeColor) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
color: isDark ? const Color(0xFF2A2A2A) : Colors.grey[50],
@@ -696,27 +699,15 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
),
if (_isPinned) ...[
const SizedBox(width: 16),
Icon(Icons.push_pin, size: 14, color: AppConstants.primaryColor),
Icon(Icons.push_pin, size: 14, color: themeColor),
const SizedBox(width: 4),
Text(
'已置顶',
style: TextStyle(
fontSize: 12,
color: AppConstants.primaryColor,
),
),
Text('已置顶', style: TextStyle(fontSize: 12, color: themeColor)),
],
if (_isLocked) ...[
const SizedBox(width: 16),
Icon(Icons.lock, size: 14, color: AppConstants.primaryColor),
Icon(Icons.lock, size: 14, color: themeColor),
const SizedBox(width: 4),
Text(
'已锁定',
style: TextStyle(
fontSize: 12,
color: AppConstants.primaryColor,
),
),
Text('已锁定', style: TextStyle(fontSize: 12, color: themeColor)),
],
],
),
@@ -776,7 +767,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
);
}
Widget _buildTitleInput(bool isDark) {
Widget _buildTitleInput(bool isDark, Color themeColor) {
return Row(
children: [
Expanded(
@@ -786,7 +777,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: _titleFocusNode.hasFocus
? AppConstants.primaryColor.withValues(alpha: 0.5)
? themeColor.withValues(alpha: 0.5)
: (isDark
? Colors.grey[700]!
: Colors.grey.withValues(alpha: 0.2)),
@@ -859,11 +850,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
child: Row(
children: [
if (category == _category)
Icon(
Icons.check,
size: 16,
color: AppConstants.primaryColor,
),
Icon(Icons.check, size: 16, color: themeColor),
if (category == _category) const SizedBox(width: 8),
Text(
category,
@@ -884,11 +871,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
if (!_categoryOptions.contains(_category) &&
_category != null &&
_category!.isNotEmpty)
Icon(
Icons.check,
size: 16,
color: AppConstants.primaryColor,
),
Icon(Icons.check, size: 16, color: themeColor),
if (!_categoryOptions.contains(_category) &&
_category != null &&
_category!.isNotEmpty)
@@ -917,18 +900,11 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.folder_outlined,
size: 18,
color: AppConstants.primaryColor,
),
Icon(Icons.folder_outlined, size: 18, color: themeColor),
const SizedBox(width: 4),
Text(
_category ?? '分类',
style: TextStyle(
fontSize: 14,
color: AppConstants.primaryColor,
),
style: TextStyle(fontSize: 14, color: themeColor),
),
Icon(
Icons.arrow_drop_down,
@@ -944,7 +920,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
);
}
Widget _buildContentInput(bool isDark) {
Widget _buildContentInput(bool isDark, Color themeColor) {
return Container(
constraints: const BoxConstraints(minHeight: 300),
decoration: BoxDecoration(
@@ -952,7 +928,7 @@ class _CollectNotesPageState extends State<CollectNotesPage> {
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: _contentFocusNode.hasFocus
? AppConstants.primaryColor.withValues(alpha: 0.5)
? themeColor.withValues(alpha: 0.5)
: (isDark
? Colors.grey[700]!
: Colors.grey.withValues(alpha: 0.2)),