copyWith method
- @useResult
- double? max,
- EdgeInsetsGeometry? padding,
- FToasterExpandBehavior? expandBehavior,
- Duration? expandHoverEnterDuration,
- Duration? expandHoverExitDuration,
- double? expandStartSpacing,
- double? expandSpacing,
- Duration? expandDuration,
- Curve? expandCurve,
- double? collapsedProtrusion,
- double? collapsedScale,
- FToastAlignment? toastAlignment,
- FToastStyle toastStyle()?,
Returns a copy of this FToasterStyle with the given properties replaced.
Where possible, it is strongly recommended to use the CLI to generate a style and directly modify the style.
max
The maximum number of entries shown per FToastAlignment. Defaults to to 3.
padding
The toaster's padding. Defaults to EdgeInsets.symmetric(horizontal: 20, vertical: 15)
.
expandBehavior
The toaster's expansion behavior. Defaults to FToasterExpandBehavior.hoverOrPress.
expandHoverEnterDuration
The duration to wait after entering the toaster before expanding the toasts. Defaults to 200ms.
expandHoverExitDuration
The duration to wait after exiting the toaster before collapsing the toasts. Defaults to 300ms.
expandStartSpacing
The spacing below or above the toasts when they are expanded. Defaults to 16.0.
expandSpacing
The spacing between the toasts when they are expanded. Defaults to 10.0.
expandDuration
The expanding/collapsing animation duration. Defaults to 500ms.
expandCurve
The expanding/collapsing animation curve. Defaults to Curves.easeInOutCubic.
collapsedProtrusion
The protrusion of the collapsed toasts behind the front toast. This is scaled by the number of toasts in front of the toast.
Defaults to 12.0.
collapsedScale
The scaling factor pf the collapsed toasts behind the front toast. This is scaled by the number of toasts in front of the toast.
Defaults to 0.9.
toastAlignment
The toast's alignment relative to a FToaster. Defaults to FToastAlignment.bottomEnd.
toastStyle
The contained toasts' style.
Implementation
@useResult
FToasterStyle copyWith({
double? max,
EdgeInsetsGeometry? padding,
FToasterExpandBehavior? expandBehavior,
Duration? expandHoverEnterDuration,
Duration? expandHoverExitDuration,
double? expandStartSpacing,
double? expandSpacing,
Duration? expandDuration,
Curve? expandCurve,
double? collapsedProtrusion,
double? collapsedScale,
FToastAlignment? toastAlignment,
FToastStyle Function(FToastStyle)? toastStyle,
}) => FToasterStyle(
max: max ?? this.max,
padding: padding ?? this.padding,
expandBehavior: expandBehavior ?? this.expandBehavior,
expandHoverEnterDuration: expandHoverEnterDuration ?? this.expandHoverEnterDuration,
expandHoverExitDuration: expandHoverExitDuration ?? this.expandHoverExitDuration,
expandStartSpacing: expandStartSpacing ?? this.expandStartSpacing,
expandSpacing: expandSpacing ?? this.expandSpacing,
expandDuration: expandDuration ?? this.expandDuration,
expandCurve: expandCurve ?? this.expandCurve,
collapsedProtrusion: collapsedProtrusion ?? this.collapsedProtrusion,
collapsedScale: collapsedScale ?? this.collapsedScale,
toastAlignment: toastAlignment ?? this.toastAlignment,
toastStyle: toastStyle != null ? toastStyle(this.toastStyle) : this.toastStyle,
);