copyWith method

  1. @useResult
FSidebarStyle copyWith({
  1. BoxDecoration? decoration,
  2. ImageFilter? backgroundFilter,
  3. BoxConstraints? constraints,
  4. FSidebarGroupStyle groupStyle(
    1. FSidebarGroupStyle
    )?,
  5. EdgeInsetsGeometry? headerPadding,
  6. EdgeInsetsGeometry? contentPadding,
  7. EdgeInsetsGeometry? footerPadding,
})

Returns a copy of this FSidebarStyle with the given properties replaced.

Where possible, it is strongly recommended to use the CLI to generate a style and directly modify the style.

decoration

The decoration.

backgroundFilter

An optional background filter applied to the sidebar.

This is typically combined with a translucent background in decoration to create a glassmorphic effect.

constraints

The sidebar's width. Defaults to BoxConstraints.tightFor(width: 250).

groupStyle

The group's style.

headerPadding

The padding for the header section. Defaults to EdgeInsets.fromLTRB(0, 16, 0, 0).

It is recommended to set the horizontal padding to 0. This ensures that the elements such as the scrollbar is not overlapped by the content.

contentPadding

The padding for the content section. Defaults to EdgeInsets.symmetric(vertical: 12).

It is recommended to set the horizontal padding to 0. This ensures that the elements such as the scrollbar is not overlapped by the content.

footerPadding

The padding for the footer section. Defaults to EdgeInsets.fromLTRB(0, 0, 0, 16).

It is recommended to set the horizontal padding to 0. This ensures that the elements such as the scrollbar is not overlapped by the content.

Implementation

@useResult
FSidebarStyle copyWith({
  BoxDecoration? decoration,
  ImageFilter? backgroundFilter,
  BoxConstraints? constraints,
  FSidebarGroupStyle Function(FSidebarGroupStyle)? groupStyle,
  EdgeInsetsGeometry? headerPadding,
  EdgeInsetsGeometry? contentPadding,
  EdgeInsetsGeometry? footerPadding,
}) => FSidebarStyle(
  decoration: decoration ?? this.decoration,
  backgroundFilter: backgroundFilter ?? this.backgroundFilter,
  constraints: constraints ?? this.constraints,
  groupStyle: groupStyle != null ? groupStyle(this.groupStyle) : this.groupStyle,
  headerPadding: headerPadding ?? this.headerPadding,
  contentPadding: contentPadding ?? this.contentPadding,
  footerPadding: footerPadding ?? this.footerPadding,
);