CreatePollViewModel
ViewModel class for creating a poll. It handles the creation of the poll and its configuration.
Properties
The error message for the maximum number of answers allowed.
A shared flow that emits an error when the range of multiple answers is invalid.
The options for the poll.
The poll configuration. If the poll is not ready to be created, it will be null.
Indicates if the poll is ready to be created.
Functions
Create a new empty option for the poll.
Create a new poll config.
Update the text of the option. If the text already exists in another option, it will set the duplicate error to true.
Set the title of the poll.
Set if the poll allows multiple votes.
Set if the poll is annonymous.
Set the maximum number of answers allowed.
Set if the poll allows users to suggest new options.