Add Dock captions and subtle blue icon glow
This commit is contained in:
@@ -216,7 +216,7 @@ class _GlassDockState extends State<GlassDock> with TickerProviderStateMixin {
|
||||
children: [
|
||||
_item(0, Icons.calendar_month_rounded, '课表'),
|
||||
_item(1, Icons.assignment_rounded, '考试'),
|
||||
_item(2, Icons.person_rounded, '个人设置'),
|
||||
_item(2, Icons.person_rounded, '个人设置', caption: '我的'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -226,7 +226,12 @@ class _GlassDockState extends State<GlassDock> with TickerProviderStateMixin {
|
||||
);
|
||||
},
|
||||
);
|
||||
Widget _item(int index, IconData icon, String label) => Expanded(
|
||||
Widget _item(
|
||||
int index,
|
||||
IconData icon,
|
||||
String label, {
|
||||
String? caption,
|
||||
}) => Expanded(
|
||||
child: Semantics(
|
||||
label: label,
|
||||
button: true,
|
||||
@@ -279,18 +284,51 @@ class _GlassDockState extends State<GlassDock> with TickerProviderStateMixin {
|
||||
}
|
||||
: null,
|
||||
child: Center(
|
||||
child: AnimatedScale(
|
||||
scale: index == _position.round().clamp(0, 2)
|
||||
? 1 + _pressure * 0.08
|
||||
: 1,
|
||||
duration: const Duration(milliseconds: 130),
|
||||
child: Icon(
|
||||
icon,
|
||||
size: 27,
|
||||
color: index == _position.round().clamp(0, 2)
|
||||
? _blue
|
||||
: _blue.withValues(alpha: 0.48),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
AnimatedScale(
|
||||
scale: index == _position.round().clamp(0, 2)
|
||||
? 1 + _pressure * 0.08
|
||||
: 1,
|
||||
duration: const Duration(milliseconds: 130),
|
||||
child: Icon(
|
||||
icon,
|
||||
size: 27,
|
||||
color: index == _position.round().clamp(0, 2)
|
||||
? _blue
|
||||
: _blue.withValues(alpha: 0.48),
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: _blue.withValues(
|
||||
alpha: index == _position.round().clamp(0, 2)
|
||||
? 0.20
|
||||
: 0.08,
|
||||
),
|
||||
blurRadius: 6,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
Flexible(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text(
|
||||
caption ?? label,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
height: 1.1,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: index == _position.round().clamp(0, 2)
|
||||
? _blue
|
||||
: _blue.withValues(alpha: 0.62),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user