showMaterialBanner static method

void showMaterialBanner({
  1. Key? key,
  2. required Widget content,
  3. TextStyle? contentTextStyle,
  4. List<Widget>? actions,
  5. double? elevation,
  6. Widget? leading,
  7. Color? backgroundColor,
  8. Color? surfaceTintColor,
  9. Color? shadowColor,
  10. Color? dividerColor,
  11. EdgeInsetsGeometry? padding,
  12. EdgeInsetsGeometry? margin,
  13. EdgeInsetsGeometry? leadingPadding,
  14. bool forceActionsBelow = false,
  15. OverflowBarAlignment overflowAlignment = OverflowBarAlignment.end,
  16. Animation<double>? animation,
  17. void onVisible()?,
})

Implementation

static void showMaterialBanner({
  Key? key,
  required Widget content,
  TextStyle? contentTextStyle,
  List<Widget>? actions,
  double? elevation,
  Widget? leading,
  Color? backgroundColor,
  Color? surfaceTintColor,
  Color? shadowColor,
  Color? dividerColor,
  EdgeInsetsGeometry? padding,
  EdgeInsetsGeometry? margin,
  EdgeInsetsGeometry? leadingPadding,
  bool forceActionsBelow = false,
  OverflowBarAlignment overflowAlignment = OverflowBarAlignment.end,
  Animation<double>? animation,
  void Function()? onVisible,
}) {
  scaffoldMessengerKey.currentState?.showMaterialBanner(MaterialBanner(
    key: key,
    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: animation,
    onVisible: onVisible,
  ));
}