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

SliverAppBar

Название типаПоддерживает анимации свойствКонтроллируемый по умолчаниюМожет содержать связанное действиеСсылка
SliverAppBar✔️✗✗link
Атрибуты (устаревшие модели)
final class SliverAppBarAttributes extends AnimatedPropertyOwner
implements DuitAttributes<SliverAppBarAttributes> {
final NonChildWidget? leading, title, bottom, flexibleSpace;
final List<NonChildWidget>? actions;
final EdgeInsetsGeometry? actionsPadding;
final Color? backgroundColor, foregroundColor, surfaceTintColor, shadowColor;
final double bottomOpacity, toolbarOpacity;
final double? elevation, scrolledUnderElevation, toolbarHeight, leadingWidth, titleSpacing, collapsedHeight, expandedHeight, stretchTriggerOffset;
final bool automaticallyImplyLeading, excludeHeaderSemantics, forceMaterialTransparency, primary, forceElevated, useDefaultSemanticsOrder, stretch, floating, pinned, snap;
final TextStyle? toolbarTextStyle, titleTextStyle;
final bool? centerTitle;
final ShapeBorder? shape;
final Clip? clipBehavior;

const SliverAppBarAttributes({
required this.automaticallyImplyLeading,
required this.excludeHeaderSemantics,
required this.forceMaterialTransparency,
required this.primary,
required this.bottomOpacity,
required this.toolbarOpacity,
required this.floating,
required this.pinned,
required this.snap,
required this.stretch,
required this.collapsedHeight,
required this.stretchTriggerOffset,
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,
this.expandedHeight,
required this.forceElevated,
required this.useDefaultSemanticsOrder,
required super.parentBuilderId,
required super.affectedProperties,
});

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

SliverAppBar(
&duit_attributes.SliverAppBarAttributes{
AutomaticallyImplyLeading: true,
ExcludeHeaderSemantics: false,
ForceMaterialTransparency: false,
Primary: true,
BottomOpacity: 1.0,
ToolbarOpacity: 1.0,
Floating: true,
Pinned: true,
Snap: false,
Stretch: false,
CollapsedHeight: 56,
StretchTriggerOffset: 0.0,
ForceElevated: false,
UseDefaultSemanticsOrder: false,
Title: "My App",
BackgroundColor: duit_color.Color{R: 33, G: 150, B: 243, A: 255},
Elevation: 4,
},
"id",
false,
//flexibleSpace,
)