ui细节优化

This commit is contained in:
Developer
2026-04-01 04:45:33 +08:00
parent 6517a78c7e
commit 79f7269319
23 changed files with 3299 additions and 885 deletions

View File

@@ -21,8 +21,14 @@ class TabbedNavAppBar {
EdgeInsetsGeometry? tabLabelPadding,
}) {
return AppBar(
toolbarHeight: AppConstants.tabbedPageToolbarHeight,
title: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)),
title: Text(
title,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
color: Colors.black87,
),
),
backgroundColor: Colors.white,
foregroundColor: Colors.black87,
iconTheme: const IconThemeData(color: Colors.black87),
@@ -33,34 +39,21 @@ class TabbedNavAppBar {
centerTitle: true,
leading: leading,
actions: actions,
// 用 PreferredSize + 固定高度略小于默认 Tab 行,减少两页相同的「标题+Tab」总高度当前 SDK 无 tabHeight 参数)
bottom: PreferredSize(
preferredSize: Size.fromHeight(AppConstants.tabbedPageTabBarHeight),
child: SizedBox(
height: AppConstants.tabbedPageTabBarHeight,
child: TabBar(
controller: tabController,
isScrollable: tabBarScrollable,
padding:
tabPadding ??
(tabBarScrollable
? const EdgeInsets.only(
left: AppConstants.pageHorizontalPadding,
right: 8,
)
: null),
labelPadding: tabLabelPadding,
tabAlignment: tabBarScrollable ? TabAlignment.start : null,
dividerHeight: 0,
dividerColor: Colors.transparent,
tabs: tabLabels.map((String e) => Tab(text: e)).toList(),
labelColor: AppConstants.primaryColor,
unselectedLabelColor: Colors.grey[600],
indicatorColor: AppConstants.primaryColor,
indicatorWeight: 3,
labelStyle: const TextStyle(fontWeight: FontWeight.bold),
),
bottom: TabBar(
controller: tabController,
isScrollable: tabBarScrollable,
padding: tabPadding,
labelPadding: tabLabelPadding,
tabAlignment: tabBarScrollable ? TabAlignment.start : null,
dividerHeight: 0,
dividerColor: Colors.transparent,
tabs: tabLabels.map((String e) => Tab(text: e)).toList(),
labelColor: AppConstants.primaryColor,
unselectedLabelColor: Colors.grey[600],
indicator: UnderlineTabIndicator(
borderSide: BorderSide(color: AppConstants.primaryColor, width: 3),
),
labelStyle: const TextStyle(fontWeight: FontWeight.bold),
),
);
}