TIMUIKitChatProviderScope constructor

TIMUIKitChatProviderScope({
  1. Key? key,
  2. Widget? child,
  3. List<SingleChildWidget>? providers,
  4. List<V2TimGroupMemberFullInfo?>? groupMemberList,
  5. TIMUIKitInputTextFieldController? textFieldController,
  6. required Widget builder(
    1. BuildContext,
    2. TUIChatSeparateViewModel,
    3. Widget?
    ),
  7. TUIChatSeparateViewModel? model,
  8. String? groupID,
  9. bool? isBuild,
  10. required String conversationID,
  11. required ConvType conversationType,
  12. TIMUIKitChatController? controller,
  13. TIMUIKitChatConfig? config,
  14. ChatLifeCycle? lifeCycle,
  15. AutoScrollController? scrollController,
})

Implementation

TIMUIKitChatProviderScope(
    {Key? key,
    this.child,
    this.providers,
    this.groupMemberList,
    this.textFieldController,
    required this.builder,
    this.model,
    this.groupID,
    this.isBuild,
    required this.conversationID,
    required this.conversationType,
    this.controller,
    this.config,
    this.lifeCycle,
    this.scrollController})
    : super(key: key) {
  if (isBuild ?? false) {
    return;
  }
  model ??= TUIChatSeparateViewModel();
  controller?.model = model;
  controller?.textFieldController = textFieldController;
  controller?.scrollController = scrollController;
  if (config != null) {
    model?.chatConfig = config!;
  }
  model?.lifeCycle = lifeCycle;
  model?.initForEachConversation(
    conversationType,
    conversationID,
    (String value) {
      textFieldController?.textEditingController?.text = value;
    },
    preGroupMemberList: groupMemberList,
    groupID: groupID,
  );
  model?.showC2cMessageEditStatus = (conversationType == ConvType.c2c ? config?.showC2cMessageEditStatus ?? true : false);
  loadData();
}