CommentReportProvider class

Provider for managing the comment/user reporting flow.

This provider manages the state of the reporting dialog, including the selected reason, whether to report the user, and whether to block them.

Example:

final provider = CommentReportProvider(
  commentService,
  () => print('User was blocked'),
);
Inheritance

Constructors

CommentReportProvider(CommentService service, dynamic onUserBlocked())
Creates a new CommentReportProvider.

Properties

blockUser bool
Whether the user should be blocked.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
loading bool
Whether a report is currently being submitted.
no setter
onUserBlocked → dynamic Function()
Callback invoked when a user is blocked.
final
reportUser bool
Whether the user should be reported.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedReason ReportReason?
The reason selected for reporting the comment.
getter/setter pair
service CommentService
The service for sending reports.
final
step ReportStep
The current step in the report flow.
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
goToNextStep() → void
Advances to the next step in the report flow.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
Resets the report provider to its initial state.
selectReason(ReportReason reason) → void
Selects a reason for reporting the comment.
submitReport(String commentId, String userId) Future<void>
Submits the report to the server.
toggleBlockUser(bool? value) → void
Toggles whether to block the user.
toggleReportUser(bool? value) → void
Toggles whether to report the user.
toString() String
A string representation of this object.
inherited

Operators

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