showMessage method
void
showMessage(
- String message, {
- String? title,
- MessageVariant type = MessageVariant.success,
- MessagePosition position = MessagePosition.top,
- Color? background,
- Style style = Style.flat,
show message
Implementation
void showMessage(
String message, {
String? title,
MessageVariant type = MessageVariant.success,
MessagePosition position = MessagePosition.top,
Color? background,
Style style = Style.flat,
}) {
if (position == MessagePosition.top) {
showTopSnackBar(
this,
_styleButton(
message: message,
title: title,
position: position,
type: type,
background: background,
style: style,
),
);
} else {
ScaffoldMessenger.of(this).clearSnackBars();
ScaffoldMessenger.of(this).showSnackBar(
SnackBar(
padding: EdgeInsets.zero,
elevation: 0,
backgroundColor: style == Style.flat
? Colors.transparent
: background ?? _bg(type),
content: _styleButton(
message: message,
title: title,
type: type,
background: background,
style: style,
),
),
);
}
}