sendMessage method
Displays a NotificationMessage to the user, if a NotificationMessage is already displayed, it will be sent to the display queue.
If you have any middleware registered, it will be called previously.
Example:
messageHandler.sendMessage(
message: NotificationMessage(
title: "title", //optional, default -> null
content: "testando modal bottom sheet", // required
type: NotificationMessageType.bottomSheet, //optional, default -> alertDialog
level: NotificationMessageLevel.info, //optional, default -> error
onDismiss: () { // optional, default -> null
}
),
);
Implementation
@override
void sendMessage({required NotificationMessage message}) {
_controller.sendMessage(message);
_controller.consumeMessage();
}