Перейти к основному содержимому

AppBar

Название типаПоддерживает анимации свойствКонтроллируемый по умолчаниюМожет содержать связанное действиеСсылка
AppBar✔️✔️✗link
Атрибуты (устаревшие модели)
/// A class that represents the attributes for an AppBar widget.
///
/// This class contains all the customizable properties that can be applied to an AppBar,
/// including visual properties like colors and dimensions, as well as child widgets
/// like the leading widget, title, and actions.
///
/// Properties are divided into two main categories:
/// - Widget properties (leading, title, bottom, etc.) that represent child widgets
/// - Visual properties (colors, dimensions, etc.) that control the AppBar's appearance
final class AppBarAttributes extends AnimatedPropertyOwner
implements DuitAttributes<AppBarAttributes> {
// NOTE: children properties with [Widget] type
final NonChildWidget? leading, title, bottom, flexibleSpace;
final List<NonChildWidget>? actions;

//NOTE: other attributes properties
final EdgeInsetsGeometry? actionsPadding;
final Color? backgroundColor, foregroundColor, surfaceTintColor, shadowColor;
final double bottomOpacity, toolbarOpacity;
final double? elevation,
scrolledUnderElevation,
toolbarHeight,
leadingWidth,
titleSpacing;
final bool automaticallyImplyLeading,
excludeHeaderSemantics,
forceMaterialTransparency,
primary;
final TextStyle? toolbarTextStyle, titleTextStyle;
final bool? centerTitle;
final ShapeBorder? shape;
final Clip? clipBehavior;

const AppBarAttributes({
required this.automaticallyImplyLeading,
required this.excludeHeaderSemantics,
required this.forceMaterialTransparency,
required this.primary,
required this.bottomOpacity,
required this.toolbarOpacity,
this.leading,
this.title,
this.actions,
this.bottom,
this.actionsPadding,
this.backgroundColor,
this.foregroundColor,
this.surfaceTintColor,
this.shadowColor,
this.elevation,
this.scrolledUnderElevation,
this.toolbarHeight,
this.leadingWidth,
this.titleSpacing,
this.toolbarTextStyle,
this.titleTextStyle,
this.centerTitle,
this.shape,
this.clipBehavior,
this.flexibleSpace,
required super.parentBuilderId,
required super.affectedProperties,
});

Пример использования​

AppBar(
&duit_attributes.AppBarAttributes[duit_color.ColorString, duit_edge_insets.EdgeInsetsLTRB, duit_decoration.RoundedRectangleBorder[duit_color.ColorString]]{
BackgroundColor: "#ff0000",
ActionsPadding: [4]float32{12.0, 0.0, 0.0, 12.0},
Title: //child,
},
"id",
)