Skip to main content

Alerts and Popups

Alerts and Popups

Used for rendering Alert Popups, and prompting confirmation from the user.

To get started using it, you must use KmpAlert. KmpAlert automatically handles dispatching the rendering of popups into the main thread, so you don't need to worry about wrapping KmpAlert with KmpMainThread. Everything is done automatically for you. All functions are thread safe and main thread safe.

Present a simple Alert


_1
KmpAlert.showAlert("Alert message I want to show to the user", "ALERT POPUP TITLE")

Run an action on Click

To present a simple Alert popup with an Action if a user presses the "Ok" button:


_3
KmpAlert.showAlert("Alert message I want to show to the user", "ALERT POPUP TITLE", "Ok") {
_3
// my action to invoke goes here
_3
}

Any Setup Required?

None