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