ChatProvider constructor
ChatProvider({
- required ChatController controller,
- required String chatId,
- required ChatConfig config,
Creates a new ChatProvider.
Automatically sets up listeners on inputController and controller to notify listeners
when input changes or when the controller state changes.
All parameters are required:
controller: The ChatController to use for operationschatId: The ID of the chat to manage messages forconfig: The ChatConfig for validation and configuration
Implementation
ChatProvider({
required this.controller,
required this.chatId,
required this.config,
}) {
inputController.addListener(() {
notifyListeners();
});
// Listen to controller changes to propagate them to UI
controller.addListener(_onControllerChange);
}