copyWith method
- @useResult
- BoxConstraints? constraints,
- BoxDecorationDelta? decoration,
- ImageFilter? backgroundFilter = imageFilterSentinel,
- EdgeInsetsGeometry? padding,
- IconThemeDataDelta? iconStyle,
- double? iconSpacing,
- TextStyleDelta? titleTextStyle,
- double? titleSpacing,
- TextStyleDelta? descriptionTextStyle,
- double? suffixSpacing,
- FToastMotionDelta? motion,
Returns a copy of this FToastStyle with the given properties replaced.
See customizing widget styles.
Parameters
- FToastStyle.constraints - The toast's constraints.
- FToastStyle.decoration - The toast's decoration.
- FToastStyle.backgroundFilter - An optional background filter.
- FToastStyle.padding - The toast content's padding.
- FToastStyle.iconStyle - The style of the toast's prefix icon.
- FToastStyle.iconSpacing - The spacing between the icon and the title.
- FToastStyle.titleTextStyle - The title's text style.
- FToastStyle.titleSpacing - The spacing between the title and description Defaults to 5.0.
- FToastStyle.descriptionTextStyle - The description's text style.
- FToastStyle.suffixSpacing - The spacing between the icon and the title.
- FToastStyle.motion - The motion-related properties.
Implementation
@useResult
FToastStyle copyWith({
BoxConstraints? constraints,
BoxDecorationDelta? decoration,
ImageFilter? backgroundFilter = imageFilterSentinel,
EdgeInsetsGeometry? padding,
IconThemeDataDelta? iconStyle,
double? iconSpacing,
TextStyleDelta? titleTextStyle,
double? titleSpacing,
TextStyleDelta? descriptionTextStyle,
double? suffixSpacing,
FToastMotionDelta? motion,
}) => .new(
constraints: constraints ?? this.constraints,
decoration: decoration?.call(this.decoration) ?? this.decoration,
backgroundFilter: backgroundFilter == imageFilterSentinel ? this.backgroundFilter : backgroundFilter,
padding: padding ?? this.padding,
iconStyle: iconStyle?.call(this.iconStyle) ?? this.iconStyle,
iconSpacing: iconSpacing ?? this.iconSpacing,
titleTextStyle: titleTextStyle?.call(this.titleTextStyle) ?? this.titleTextStyle,
titleSpacing: titleSpacing ?? this.titleSpacing,
descriptionTextStyle: descriptionTextStyle?.call(this.descriptionTextStyle) ?? this.descriptionTextStyle,
suffixSpacing: suffixSpacing ?? this.suffixSpacing,
motion: motion?.call(this.motion) ?? this.motion,
);