CodeChatUI<T> constructor

const CodeChatUI<T>({
  1. Key? key,
  2. required String url,
  3. required Map<String, dynamic> requestBuilder(
    1. String input
    ),
  4. required void onResponseSuccess(
    1. dynamic response,
    2. String input
    ),
  5. required ValueNotifier<List<T>> chatsValueListenable,
  6. required Widget chatBuilder(
    1. BuildContext context,
    2. T chat
    ),
  7. Map<String, String>? headerRequest,
  8. void onFailure(
    1. dynamic error,
    2. dynamic response,
    3. String input
    )?,
  9. PreferredSizeWidget? appBar,
  10. Widget sendButtonBuilder(
    1. BuildContext context,
    2. void onSend()
    )?,
  11. Widget textFormFieldBuilder(
    1. BuildContext context,
    2. TextEditingController controller,
    3. FocusNode focusNode,
    4. void onFieldSubmitted(),
    )?,
  12. Widget? loadingIndicator,
})

Implementation

const CodeChatUI({
  Key? key,
  required this.url,
  required this.requestBuilder,
  required this.onResponseSuccess,
  required this.chatsValueListenable,
  required this.chatBuilder,
  this.headerRequest,
  this.onFailure,
  this.appBar,
  this.sendButtonBuilder,
  this.textFormFieldBuilder,
  this.loadingIndicator,
}) : super(key: key);