copyWith method
ToastTheme
copyWith({
- ValueGetter<
int?> ? maxStackedEntries, - ValueGetter<
EdgeInsetsGeometry?> ? padding, - ValueGetter<
ExpandMode?> ? expandMode, - ValueGetter<
Offset?> ? collapsedOffset, - ValueGetter<
double?> ? collapsedScale, - ValueGetter<
Curve?> ? expandingCurve, - ValueGetter<
Duration?> ? expandingDuration, - ValueGetter<
double?> ? collapsedOpacity, - ValueGetter<
double?> ? entryOpacity, - ValueGetter<
double?> ? spacing, - ValueGetter<
BoxConstraints?> ? toastConstraints,
Type definition for toast content builder functions.
Takes a BuildContext and ToastOverlay instance, returning the widget that represents the toast's visual content. The overlay parameter provides control methods for dismissing or manipulating the toast notification.
Example:
ToastBuilder builder = (context, overlay) => Card(
child: ListTile(
title: Text('Notification'),
trailing: IconButton(
icon: Icon(Icons.close),
onPressed: overlay.close,
),
),
);
Implementation
ToastTheme copyWith({
ValueGetter<int?>? maxStackedEntries,
ValueGetter<EdgeInsetsGeometry?>? padding,
ValueGetter<ExpandMode?>? expandMode,
ValueGetter<Offset?>? collapsedOffset,
ValueGetter<double?>? collapsedScale,
ValueGetter<Curve?>? expandingCurve,
ValueGetter<Duration?>? expandingDuration,
ValueGetter<double?>? collapsedOpacity,
ValueGetter<double?>? entryOpacity,
ValueGetter<double?>? spacing,
ValueGetter<BoxConstraints?>? toastConstraints,
}) {
return ToastTheme(
maxStackedEntries: maxStackedEntries == null
? this.maxStackedEntries
: maxStackedEntries(),
padding: padding == null ? this.padding : padding(),
expandMode: expandMode == null ? this.expandMode : expandMode(),
collapsedOffset:
collapsedOffset == null ? this.collapsedOffset : collapsedOffset(),
collapsedScale:
collapsedScale == null ? this.collapsedScale : collapsedScale(),
expandingCurve:
expandingCurve == null ? this.expandingCurve : expandingCurve(),
expandingDuration: expandingDuration == null
? this.expandingDuration
: expandingDuration(),
collapsedOpacity:
collapsedOpacity == null ? this.collapsedOpacity : collapsedOpacity(),
entryOpacity: entryOpacity == null ? this.entryOpacity : entryOpacity(),
spacing: spacing == null ? this.spacing : spacing(),
toastConstraints:
toastConstraints == null ? this.toastConstraints : toastConstraints(),
);
}