onInit method

  1. @override
void onInit()
override

Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.

Implementation

@override
void onInit() {
  const String constText =
      "How can I help you with this conversation? Please ask me a question, and I will give advice to you 😄.";

  super.onInit();
  AIAssistBotMessage message = AIAssistBotMessage(
      id: messageId,
      message: constText,
      sentStatus: AIMessageStatus.sent,
      isSentByMe: false,
      sentAt: DateTime.now());
  messageId++;
  list.add(message);
  update();
  textEditingController = TextEditingController(text: null);
}