import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class CustomAppBar extends AppBar {
final Widget? leading;
final bool automaticallyImplyLeading;
final Widget? title;
final List<Widget>? actions;
final Widget? flexibleSpace;
final PreferredSizeWidget? bottom;
final double elevation;
final Color? shadowColor;
final ShapeBorder? shape;
final Color backgroundColor;
final SystemUiOverlayStyle brightness;
final IconThemeData? iconTheme;
final IconThemeData? actionsIconTheme;
final TextTheme? textTheme;
final bool primary;
final bool? centerTitle;
final bool excludeHeaderSemantics;
final double titleSpacing;
final double toolbarOpacity;
final double bottomOpacity;
final double? toolbarHeight;
final double? leadingWidth;
final double? scrolledUnderElevation;
final Color? surfaceTintColor;
CustomAppBar({
Key? key,
this.leading,
this.automaticallyImplyLeading = true,
this.title,
this.actions,
this.flexibleSpace,
this.bottom,
this.elevation = 0,
this.shadowColor,
this.shape,
this.backgroundColor = Colors.white,
this.brightness = SystemUiOverlayStyle.dark,
this.iconTheme,
this.actionsIconTheme,
this.textTheme,
this.primary = true,
this.centerTitle,
this.excludeHeaderSemantics = false,
this.titleSpacing = NavigationToolbar.kMiddleSpacing,
this.toolbarOpacity = 1.0,
this.bottomOpacity = 1.0,
this.toolbarHeight,
this.leadingWidth,
this.scrolledUnderElevation = 0.0,
this.surfaceTintColor = Colors.transparent //配置透明色去掉滚动列表后的淡蓝色蒙层
}) : assert(elevation >= 0.0),
super(
key: key,
leading: leading,
automaticallyImplyLeading: automaticallyImplyLeading,
title: title,
actions: actions,
flexibleSpace: flexibleSpace,
bottom: bottom,
elevation: elevation,
shadowColor: shadowColor,
shape: shape,
backgroundColor: backgroundColor,
systemOverlayStyle: brightness,
iconTheme: iconTheme,
actionsIconTheme: actionsIconTheme,
primary: primary,
centerTitle: centerTitle,
excludeHeaderSemantics: excludeHeaderSemantics,
titleSpacing: titleSpacing,
toolbarOpacity: toolbarOpacity,
bottomOpacity: bottomOpacity,
toolbarHeight: toolbarHeight,
leadingWidth: leadingWidth, toolbarTextStyle: textTheme?.bodyMedium, titleTextStyle: textTheme?.titleLarge,
scrolledUnderElevation: scrolledUnderElevation,
surfaceTintColor: surfaceTintColor
);
}
flutter AppBar去掉列表滚动后的淡蓝色蒙层
最新推荐文章于 2026-08-24 00:01:02 发布

224

被折叠的 条评论
为什么被折叠?



