release
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../config/app_config.dart';
|
||||
import '../../services/get/theme_controller.dart';
|
||||
import '../../services/get/tap_liquid_glass_controller.dart';
|
||||
|
||||
class CareModeNavigation extends StatelessWidget {
|
||||
final int currentIndex;
|
||||
@@ -22,13 +23,21 @@ class CareModeNavigation extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final themeController = Get.find<ThemeController>();
|
||||
final glassController = Get.find<TapLiquidGlassController>();
|
||||
|
||||
return Obx(() {
|
||||
final isDark = themeController.isDarkMode;
|
||||
final enableBlur = themeController.enableBlurEffect;
|
||||
final primaryColor = themeController.currentThemeColor;
|
||||
final transparencyValues = glassController.transparencyValues;
|
||||
|
||||
return _buildGlassBar(context, isDark, enableBlur, primaryColor);
|
||||
return _buildGlassBar(
|
||||
context,
|
||||
isDark,
|
||||
enableBlur,
|
||||
primaryColor,
|
||||
transparencyValues,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -37,78 +46,92 @@ class CareModeNavigation extends StatelessWidget {
|
||||
bool isDark,
|
||||
bool enableBlur,
|
||||
Color primaryColor,
|
||||
Map<String, double> transparencyValues,
|
||||
) {
|
||||
final backgroundOpacity = transparencyValues['backgroundOpacity']!;
|
||||
return SafeArea(
|
||||
top: false,
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: AppConfig.liquidGlassHorizontalMargin,
|
||||
right: AppConfig.liquidGlassHorizontalMargin,
|
||||
bottom: AppConfig.liquidGlassBottomMargin,
|
||||
top: 8,
|
||||
bottom: 16,
|
||||
top: 16,
|
||||
),
|
||||
child: Container(
|
||||
height: AppConfig.liquidGlassHeight,
|
||||
height: AppConfig.liquidGlassHeight, // 使用原始高度
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.liquidGlassCornerRadius,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: isDark
|
||||
? Colors.black.withValues(alpha: 0.6)
|
||||
: Colors.black.withValues(alpha: 0.15),
|
||||
blurRadius: 35,
|
||||
spreadRadius: -10,
|
||||
offset: const Offset(0, 12),
|
||||
),
|
||||
],
|
||||
boxShadow: backgroundOpacity > 0.2
|
||||
? [
|
||||
BoxShadow(
|
||||
color: isDark
|
||||
? Colors.black.withValues(alpha: 0.6)
|
||||
: Colors.black.withValues(alpha: 0.15),
|
||||
blurRadius: 35,
|
||||
spreadRadius: -10,
|
||||
offset: const Offset(0, 12),
|
||||
),
|
||||
]
|
||||
: [],
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.liquidGlassCornerRadius,
|
||||
),
|
||||
child: enableBlur
|
||||
child: enableBlur && backgroundOpacity >= 0.01
|
||||
? BackdropFilter(
|
||||
filter: ImageFilter.blur(
|
||||
sigmaX: AppConfig.liquidGlassBlur,
|
||||
sigmaY: AppConfig.liquidGlassBlur,
|
||||
),
|
||||
child: _buildGlassContent(isDark, primaryColor),
|
||||
child: _buildGlassContent(
|
||||
isDark,
|
||||
primaryColor,
|
||||
backgroundOpacity,
|
||||
),
|
||||
)
|
||||
: _buildGlassContent(isDark, primaryColor),
|
||||
: _buildGlassContent(isDark, primaryColor, backgroundOpacity),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildGlassContent(bool isDark, Color primaryColor) {
|
||||
Widget _buildGlassContent(
|
||||
bool isDark,
|
||||
Color primaryColor,
|
||||
double backgroundOpacity,
|
||||
) {
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: isDark
|
||||
? Colors.black.withValues(alpha: 0.4)
|
||||
: Colors.white.withValues(alpha: 0.9),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.liquidGlassCornerRadius,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.liquidGlassCornerRadius,
|
||||
),
|
||||
border: Border.all(
|
||||
if (backgroundOpacity >= 0.1)
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: isDark
|
||||
? Colors.white.withValues(alpha: 0.2)
|
||||
: Colors.black.withValues(alpha: 0.1),
|
||||
width: 0.6,
|
||||
? Colors.black.withValues(alpha: backgroundOpacity * 0.4)
|
||||
: Colors.white.withValues(alpha: backgroundOpacity),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.liquidGlassCornerRadius,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (backgroundOpacity >= 0.15)
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.liquidGlassCornerRadius,
|
||||
),
|
||||
border: Border.all(
|
||||
color: isDark
|
||||
? Colors.white.withValues(alpha: backgroundOpacity * 0.2)
|
||||
: Colors.black.withValues(alpha: backgroundOpacity * 0.1),
|
||||
width: 0.6,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
_buildNavItems(primaryColor),
|
||||
],
|
||||
);
|
||||
@@ -149,43 +172,45 @@ class CareModeNavigation extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.liquidGlassCornerRadius,
|
||||
),
|
||||
child: AnimatedContainer(
|
||||
duration: enableAnimation
|
||||
? const Duration(milliseconds: 250)
|
||||
: Duration.zero,
|
||||
curve: Curves.easeOutCubic,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
enableAnimation
|
||||
? AnimatedScale(
|
||||
scale: isSelected ? 1.1 : 1.0,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeOutCubic,
|
||||
child: _buildIcon(
|
||||
item,
|
||||
isSelected,
|
||||
isDark,
|
||||
primaryColor,
|
||||
),
|
||||
)
|
||||
: _buildIcon(item, isSelected, isDark, primaryColor),
|
||||
const SizedBox(height: 3),
|
||||
AnimatedDefaultTextStyle(
|
||||
duration: enableAnimation
|
||||
? const Duration(milliseconds: 200)
|
||||
: Duration.zero,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: isSelected ? FontWeight.w600 : FontWeight.w400,
|
||||
color: isSelected
|
||||
? primaryColor
|
||||
: (isDark ? Colors.grey[400] : Colors.grey[600]),
|
||||
letterSpacing: 0.15,
|
||||
child: SizedBox(
|
||||
height: AppConfig.liquidGlassHeight, // 使用原始高度
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
enableAnimation
|
||||
? AnimatedScale(
|
||||
scale: isSelected ? 1.1 : 1.0,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeOutCubic,
|
||||
child: _buildIcon(
|
||||
item,
|
||||
isSelected,
|
||||
isDark,
|
||||
primaryColor,
|
||||
),
|
||||
)
|
||||
: _buildIcon(item, isSelected, isDark, primaryColor),
|
||||
const SizedBox(width: 10),
|
||||
AnimatedDefaultTextStyle(
|
||||
duration: enableAnimation
|
||||
? const Duration(milliseconds: 200)
|
||||
: Duration.zero,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: isSelected
|
||||
? FontWeight.w600
|
||||
: FontWeight.w500,
|
||||
color: isSelected
|
||||
? primaryColor
|
||||
: (isDark ? Colors.grey[300] : Colors.grey[700]),
|
||||
letterSpacing: 0.15,
|
||||
),
|
||||
child: Text(item.label),
|
||||
),
|
||||
child: Text(item.label),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -201,10 +226,10 @@ class CareModeNavigation extends StatelessWidget {
|
||||
) {
|
||||
return Icon(
|
||||
item.icon,
|
||||
size: 24,
|
||||
size: 28,
|
||||
color: isSelected
|
||||
? primaryColor
|
||||
: (isDark ? Colors.grey[400] : Colors.grey[600]),
|
||||
: (isDark ? Colors.grey[300] : Colors.grey[700]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,10 @@ class MainNavigation extends StatelessWidget {
|
||||
/// 使用 Stack 布局,让导航栏悬浮在页面内容上方
|
||||
Widget _buildCareModeBody(CareController careController) {
|
||||
return Obx(() {
|
||||
final carePages = [const CarePoetryPage(), const PoetryLevelPage()];
|
||||
final carePages = [
|
||||
const CarePoetryPage(),
|
||||
const PoetryLevelPage(showBackButton: false, showAppBar: false),
|
||||
];
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
|
||||
@@ -194,7 +194,7 @@ class TapLiquidGlassNavigation extends StatelessWidget {
|
||||
|
||||
Widget _buildIcon(_NavItem item, bool isSelected, bool isDark) {
|
||||
final themeController = Get.find<ThemeController>();
|
||||
|
||||
|
||||
return Icon(
|
||||
item.icon,
|
||||
size: 24,
|
||||
|
||||
Reference in New Issue
Block a user