fix:UI对齐demo

This commit is contained in:
jingyun
2026-06-18 18:08:29 +08:00
parent f42ad566e0
commit 2d7523f901
14 changed files with 1613 additions and 355 deletions
+16 -2
View File
@@ -101,7 +101,7 @@ class _TabShellState extends State<TabShell> {
),
bottomNavigationBar: DecoratedBox(
decoration: BoxDecoration(
color: cs.background,
color: Colors.white,
border: Border(top: BorderSide(color: cs.border, width: 1)),
),
child: SafeArea(
@@ -155,12 +155,26 @@ class _TabButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final cs = ShadTheme.of(context).colorScheme;
final color = selected ? cs.foreground : cs.mutedForeground;
final color = selected ? cs.primary : cs.mutedForeground;
return InkWell(
onTap: onTap,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (selected)
Container(
width: 22,
height: 2.5,
margin: const EdgeInsets.only(bottom: 6),
decoration: BoxDecoration(
color: cs.primary,
borderRadius: const BorderRadius.vertical(
bottom: Radius.circular(3),
),
),
)
else
const SizedBox(height: 8.5),
Icon(icon, size: 22, color: color),
const SizedBox(height: 4),
Text(