CommentProvider constructor
CommentProvider({
- required CommentController controller,
- required String postId,
- required CommentValidator validator,
Creates a new CommentProvider.
Automatically loads comments for postId on initialization.
Sets up a listener on inputController to notify listeners when input changes.
All parameters are required:
controller: The CommentController to use for operationspostId: The ID of the entity to manage comments forvalidator: The CommentValidator to validate comment content
Implementation
CommentProvider({
required this.controller,
required this.postId,
required this.validator,
}) {
loadComments();
inputController.addListener(() {
notifyListeners();
});
}