Build: EventEmitterScreen
This screen demonstrates how to use SharedFlow to emit and collect one-time events in an Android Kotlin app. It has a button that when clicked emits an event, and a text area that shows the latest event received.
Target UI
------------------------- | Event Emitter Screen | ------------------------- | | | [Emit Event] | | | | Last Event: | | | | | -------------------------
Use MutableSharedFlow to emit string events when the button is clicked
Collect the SharedFlow in a lifecycle-aware way to update the UI with the latest event
Display the last emitted event below the button
Use Kotlin coroutines and Flow APIs
Ensure events are handled only once and UI updates accordingly