withAnimation method

MaterialBanner withAnimation(
  1. Animation<double> newAnimation,
  2. {Key? fallbackKey}
)

Creates a copy of this material banner but with the animation replaced with the given animation.

If the original material banner lacks a key, the newly created material banner will use the given fallback key.

Implementation

MaterialBanner withAnimation(Animation<double> newAnimation, { Key? fallbackKey }) {
  return MaterialBanner(
    key: key ?? fallbackKey,
    content: content,
    contentTextStyle: contentTextStyle,
    actions: actions,
    elevation: elevation,
    leading: leading,
    backgroundColor: backgroundColor,
    surfaceTintColor: surfaceTintColor,
    shadowColor: shadowColor,
    dividerColor: dividerColor,
    padding: padding,
    margin: margin,
    leadingPadding: leadingPadding,
    forceActionsBelow: forceActionsBelow,
    overflowAlignment: overflowAlignment,
    animation: newAnimation,
    onVisible: onVisible,
  );
}