fix;设置和深浅色
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../theme/app_icons.dart';
|
||||
import '../theme/yanting_text.dart';
|
||||
@@ -30,24 +31,28 @@ class BottomTabBar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = ShadTheme.of(context).colorScheme;
|
||||
return DecoratedBox(
|
||||
decoration: const BoxDecoration(
|
||||
color: YantingColors.background,
|
||||
border: Border(top: BorderSide(color: YantingColors.border)),
|
||||
),
|
||||
decoration: const BoxDecoration(color: Colors.transparent),
|
||||
child: SizedBox(
|
||||
height: YantingSpacing.tabBarHeight,
|
||||
child: Row(
|
||||
children: [
|
||||
for (var index = 0; index < items.length; index++)
|
||||
Expanded(
|
||||
child: _BottomTabButton(
|
||||
item: items[index],
|
||||
selected: index == selectedIndex,
|
||||
onTap: () => onSelected(index),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: colors.background,
|
||||
border: Border(top: BorderSide(color: colors.border)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
for (var index = 0; index < items.length; index++)
|
||||
Expanded(
|
||||
child: _BottomTabButton(
|
||||
item: items[index],
|
||||
selected: index == selectedIndex,
|
||||
onTap: () => onSelected(index),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -67,9 +72,8 @@ class _BottomTabButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = selected
|
||||
? YantingColors.foreground
|
||||
: YantingColors.mutedForeground;
|
||||
final colors = ShadTheme.of(context).colorScheme;
|
||||
final color = selected ? colors.foreground : colors.mutedForeground;
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Column(
|
||||
|
||||
Reference in New Issue
Block a user