ChatReportProvider class
Provider for managing the chat message/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 = ChatReportProvider(
chatService,
() => print('User was blocked'),
);
- Inheritance
-
- Object
- ChangeNotifier
- ChatReportProvider
Constructors
- ChatReportProvider(ChatService service, dynamic onUserBlocked())
- Creates a new ChatReportProvider.
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 ↔ ChatReportReason?
-
The reason selected for reporting the message.
getter/setter pair
- service → ChatService
-
The service for sending reports.
final
- step ↔ ChatReportStep
-
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.
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(
ChatReportReason reason) → void - Selects a reason for reporting the message.
-
submitReport(
String chatId, String messageId, String userId, String currentUserId) → 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