launchPoll function
- LaunchPollOptions options
Toggles the visibility of the poll modal based on the current state.
This function accepts LaunchPollOptions and toggles the visibility state
by calling updateIsPollModalVisible
with the negation of isPollModalVisible
.
Example:
final options = LaunchPollOptions(
updateIsPollModalVisible: (visible) => setPollModalVisible(visible),
isPollModalVisible: false,
);
launchPoll(options);
Implementation
void launchPoll(LaunchPollOptions options) {
// Toggle the visibility state of the poll modal
options.updateIsPollModalVisible(!options.isPollModalVisible);
}