Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the PollOption id type to String. #26

Closed
samuelrbrt opened this issue Sep 14, 2023 · 2 comments
Closed

Make the PollOption id type to String. #26

samuelrbrt opened this issue Sep 14, 2023 · 2 comments

Comments

@samuelrbrt
Copy link
Contributor

    PollOption(
        id: choice.key, <--- Int
        title: AutoSizeText(
          choice.title,
          style: primary14TextStyle,
        ),
        votes: choice.votes,
    );

Currently the PollOption id is an integer, now a days it's very common to use UUID string instead of int to index items in the server side for various reasons. So at the Flutter app side, we usually end up using the same option id returned by the API to uniquely identify the Poll options.

Would it be possible to change the id type to String to accomodate more such use cases?

@thenifemi
Copy link
Owner

Great insight! Fixed.

@samuelrbrt
Copy link
Contributor Author

@thenifemi Thanks for the fix. Just one more thing, the corresponding userVotedOptionId in the FlutterPolls class should also be updated accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants