VoteResult class

Result of toggling an upvote on a feature request.

Returned by POST /api/v1/feature-requests/:id/vote.

Example

final result = await client.toggleVote('fr_123', userToken: token);
print('Voted: ${result.voted}, Total count: ${result.voteCount}');

Constructors

VoteResult({required bool voted, required int voteCount})
Creates a VoteResult record.
const
VoteResult.fromJson(Map<String, dynamic> json)
Deserializes VoteResult from a server JSON response.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
voteCount int
Updated total upvote count after the change.
final
voted bool
Whether the user has an active upvote after toggling.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited