关怀模式
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../constants/app_constants.dart';
|
||||
import '../services/get/theme_controller.dart';
|
||||
|
||||
/// 时间: 2026-03-22
|
||||
/// 功能: 主导航内「标题 + Tab」共用 AppBar 构造
|
||||
@@ -23,6 +25,8 @@ class TabbedNavAppBar {
|
||||
Color? foregroundColor,
|
||||
}) {
|
||||
final isDark = backgroundColor != null && backgroundColor != Colors.white;
|
||||
final themeController = Get.find<ThemeController>();
|
||||
final primaryColor = themeController.currentThemeColor;
|
||||
|
||||
return AppBar(
|
||||
title: Text(
|
||||
@@ -55,10 +59,10 @@ class TabbedNavAppBar {
|
||||
dividerHeight: 0,
|
||||
dividerColor: Colors.transparent,
|
||||
tabs: tabLabels.map((String e) => Tab(text: e)).toList(),
|
||||
labelColor: AppConstants.primaryColor,
|
||||
labelColor: primaryColor,
|
||||
unselectedLabelColor: isDark ? Colors.grey[400] : Colors.grey[600],
|
||||
indicator: UnderlineTabIndicator(
|
||||
borderSide: BorderSide(color: AppConstants.primaryColor, width: 3),
|
||||
borderSide: BorderSide(color: primaryColor, width: 3),
|
||||
),
|
||||
labelStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user