The public ui library is used with the openim demo, and you can directly use it for secondary development.

Overview

flutter_openim_widget

The public ui library is used with the openim demo, and you can directly use it for secondary development.

pub package GitHub license

import 'package:flutter/material.dart';
import 'package:flutter_openim_widget/flutter_openim_widget.dart';
import 'package:get/get.dart';
import 'package:openim_enterprise_chat/src/res/strings.dart';
import 'package:openim_enterprise_chat/src/res/styles.dart';
import 'package:openim_enterprise_chat/src/widgets/chat_listview.dart';
import 'package:openim_enterprise_chat/src/widgets/titlebar.dart';

import 'chat_logic.dart';

class ChatPage extends StatelessWidget {
  final logic = Get.find();

  Widget _itemView(index) => ChatItemView(
        key: logic.itemKey(index),
        index: index,
        message: logic.indexOfMessage(index),
        timeStr: logic.getShowTime(index),
        isSingleChat: logic.isSingleChat,
        clickSubject: logic.clickSubject,
        msgSendStatusSubject: logic.msgSendStatusSubject,
        msgSendProgressSubject: logic.msgSendProgressSubject,
        multiSelMode: logic.multiSelMode.value,
        multiList: logic.multiSelList.value,
        allAtMap: logic.atUserNameMappingMap,
        delaySendingStatus: true,
        onMultiSelChanged: (checked) {
          logic.multiSelMsg(index, checked);
        },
        onTapCopyMenu: () {
          logic.copy(index);
        },
        onTapDelMenu: () {
          logic.deleteMsg(index);
        },
        onTapForwardMenu: () {
          logic.forward(index);
        },
        onTapReplyMenu: () {
          logic.setQuoteMsg(index);
        },
        onTapRevokeMenu: () {
          logic.revokeMsg(index);
        },
        onTapMultiMenu: () {
          logic.openMultiSelMode(index);
        },
        visibilityChange: (context, index, message, visible) {
          print('visible:$index $visible');
          logic.markC2CMessageAsRead(index, message, visible);
        },
        onLongPressLeftAvatar: () {
          logic.onLongPressLeftAvatar(index);
        },
        onLongPressRightAvatar: () {},
        onTapLeftAvatar: () {
          logic.onTapLeftAvatar(index);
        },
        onTapRightAvatar: () {},
        onClickAtText: (uid) {
          logic.clickAtText(uid);
        },
        onTapQuoteMsg: () {
          logic.onTapQuoteMsg(index);
        },
        patterns: [
          MatchPattern(
            type: PatternType.AT,
            style: PageStyle.ts_1B72EC_14sp,
            onTap: logic.clickLinkText,
          ),
          MatchPattern(
            type: PatternType.EMAIL,
            style: PageStyle.ts_1B72EC_14sp,
            onTap: logic.clickLinkText,
          ),
          MatchPattern(
            type: PatternType.URL,
            style: PageStyle.ts_1B72EC_14sp_underline,
            onTap: logic.clickLinkText,
          ),
          MatchPattern(
            type: PatternType.PHONE,
            style: PageStyle.ts_1B72EC_14sp,
            onTap: logic.clickLinkText,
          ),
        ],
      );

  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      onWillPop: () async {
        return logic.exit();
      },
      child: ChatVoiceRecordLayout(
        locale: Get.locale,
        builder: (bar) => Obx(() => Scaffold(
              backgroundColor: PageStyle.c_FFFFFF,
              appBar: EnterpriseTitleBar.chatTitle(
                title: logic.name.value,
                subTitle: logic.getSubTile(),
                onClickCallBtn: () => logic.call(),
                onClickMoreBtn: () => logic.chatSetup(),
                leftButton: logic.multiSelMode.value ? StrRes.cancel : null,
                onClose: () => logic.exit(),
                showOnlineStatus: logic.showOnlineStatus(),
                online: logic.onlineStatus.value,
              ),
              body: SafeArea(
                child: Column(
                  children: [
                    Expanded(
                      child: ChatListView(
                        listViewKey: ObjectKey(logic.listViewKey.value),
                        onTouch: () => logic.closeToolbox(),
                        itemCount: logic.messageList.length,
                        controller: logic.autoCtrl,
                        onLoad: () => logic.getHistoryMsgList(),
                        itemBuilder: (_, index) => Obx(() => _itemView(index)),
                      ),
                    ),
                    ChatInputBoxView(
                      controller: logic.inputCtrl,
                      allAtMap: logic.atUserNameMappingMap,
                      toolbox: ChatToolsView(
                        onTapAlbum: () => logic.onTapAlbum(),
                        onTapCamera: () => logic.onTapCamera(),
                        onTapCarte: () => logic.onTapCarte(),
                        onTapFile: () => logic.onTapFile(),
                        onTapLocation: () => logic.onTapLocation(),
                        onTapVideoCall: () => logic.call(),
                        onStopVoiceInput: () => logic.onStopVoiceInput(),
                        onStartVoiceInput: () => logic.onStartVoiceInput(),
                      ),
                      multiOpToolbox: ChatMultiSelToolbox(
                        onDelete: () => logic.mergeDelete(),
                        onMergeForward: () => logic.mergeForward(),
                      ),
                      emojiView: ChatEmojiView(
                        onAddEmoji: logic.onAddEmoji,
                        onDeleteEmoji: logic.onDeleteEmoji,
                      ),
                      onSubmitted: (v) => logic.sendTextMsg(),
                      forceCloseToolboxSub: logic.forceCloseToolbox,
                      voiceRecordBar: bar,
                      quoteContent: logic.quoteContent.value,
                      onClearQuote: () => logic.setQuoteMsg(-1),
                      multiMode: logic.multiSelMode.value,
                      focusNode: logic.focusNode,
                    ),
                  ],
                ),
              ),
            )),
        onCompleted: (sec, path) {
          logic.sendVoice(duration: sec, path: path);
        },
      ),
    );
  }
}


You might also like...

A flutter package which provides most commonly used widgets with their normal and neon version

A flutter package which provides most commonly used widgets with their normal and neon version

This is a flutter package which provides most commonly used widgets with their normal and neon version. There are multiple different types of widgets under this package, which can be used to create more neon theme widget

Oct 7, 2022

May be used to intercept the Android back-button, as an alternative to `WillPopScope`.

back_button_interceptor In simple cases, when you need to intercept the Android back-button, you usually add WillPopScope to your widget tree. However

Dec 12, 2022

Cupertino buttons which are used as radio buttons in order to select one value

Cupertino buttons which are used as radio buttons in order to select one value

Flutter Cupertino Radio Choice Cupertino buttons which are used as radio buttons in order to select one value. Tutorial A complete tutorial how to use

Sep 18, 2022

PlutoGrid is a dataGrid that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.

PlutoGrid is a dataGrid that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.

PlutoGrid is a dataGrid that can be controlled by the keyboard on desktop and web.

Jan 4, 2023

A widget that can be dragged and scrolled in a single gesture and snapped to a list of extents.

A widget that can be dragged and scrolled in a single gesture and snapped to a list of extents.

Sliding Sheet A widget that can be dragged and scrolled in a single gesture and snapped to a list of extents. Click here to view the full example. Ins

Mar 10, 2022

RFlutter Alert is super customizable and easy-to-use alert/popup dialogs for Flutter.

RFlutter Alert is super customizable and easy-to-use alert/popup dialogs for Flutter.

RFlutter Alert is super customizable and easy-to-use alert/popup dialogs for Flutter. You may create reusable alert styles or add buttons as much as you want with ease.

Jan 1, 2023

A package for flutter to use alert and toast within one line code.

A package for flutter to use alert and toast within one line code.

easy_alert A package for flutter to use alert and toast within one line code. Getting Started Add easy_alert: to your pubspec.yaml, and run flutt

Jun 25, 2021

A Redux version tailored for Flutter, which is easy to learn, to use, to test, and has no boilerplate

A Redux version tailored for Flutter, which is easy to learn, to use, to test, and has no boilerplate

A Redux version tailored for Flutter, which is easy to learn, to use, to test, and has no boilerplate. Allows for both sync and async reducers.

Dec 13, 2022

Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.

Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.

sticky_and_expandable_list Flutter implementation of sticky headers and expandable list.Support use it in a CustomScrollView. README i18n:中文说明 Feature

Nov 16, 2022
Comments
  • extended_editable_text版本问题

    extended_editable_text版本问题

    大佬!你们用的flutter、dart版本多少啊? 我用最新的2.10.1(flutter)、2.16.1(dart)怎么都编译不出来。 报错信息: ../../../flutter/.pub-cache/hosted/pub.flutter-io.cn/extended_text_field-9.0.3/lib/src/extended_editable_text.dart:1179:9: Error: Type 'TextEditingActionTarget' not found. TextEditingActionTarget, ^^^^^^^^^^^^^^^^^^^^^^^ ../../../flutter/.pub-cache/hosted/pub.flutter-io.cn/extended_text_field-9.0.3/lib/src/extended_editable_text.dart:1174:7: Error: The type 'TextEditingActionTarget' can't be mixed in. class ExtendedEditableTextState extends State<ExtendedEditableText> ^ ../../../flutter/.pub-cache/hosted/pub.flutter-io.cn/extended_text_field-9.0.3/lib/src/extended_editable_text.dart:2598:11: Error: Superclass has no method named 'copySelection'. super.copySelection(cause); ^^^^^^^^^^^^^ ../../../flutter/.pub-cache/hosted/pub.flutter-io.cn/extended_text_field-9.0.3/lib/src/extended_editable_text.dart:2628:11: Error: Superclass has no method named 'cutSelection'. super.cutSelection(cause); ^^^^^^^^^^^^ ../../../flutter/.pub-cache/hosted/pub.flutter-io.cn/extended_text_field-9.0.3/lib/src/extended_editable_text.dart:2638:11: Error: Superclass has no method named 'pasteText'. super.pasteText(cause); ^^^^^^^^^ ../../../flutter/.pub-cache/hosted/pub.flutter-io.cn/extended_text_field-9.0.3/lib/src/extended_editable_text.dart:2648:11: Error: Superclass has no method named 'selectAll'. super.selectAll(cause); ^^^^^^^^^ ../../../flutter/.pub-cache/hosted/pub.flutter-io.cn/extended_text_field-9.0.3/lib/src/extended_editable_text.dart:2693:11: Error: Superclass has no method named 'setSelection'. super.setSelection(nextSelection, cause);

    我分析是extended_editable_text版本低了,但是你们的flutter_openim_widget又依赖9.0.3版本。

    opened by shareCourage 2
  • iOS模拟器编译不通过,报Undefined symbol错误

    iOS模拟器编译不通过,报Undefined symbol错误

    Error (Xcode): Undefined symbol: _Open_im_sdkGetSelfUserInfo Error (Xcode): Undefined symbol: _Open_im_sdkGetUsersInfo Error (Xcode): Undefined symbol: _Open_im_sdkSetUserListener Error (Xcode): Undefined symbol: _Open_im_sdkSignalingReject Error (Xcode): Undefined symbol: _Open_im_sdkSignalingAccept Error (Xcode): Undefined symbol: _Open_im_sdkClearGroupHistoryMessage Error (Xcode): Undefined symbol: _Open_im_sdkClearC2CHistoryMessage ........

    iOS模拟器编译不通过,报Undefined symbol错误,请问如何处理? 截屏2022-04-25 16 09 20

    opened by zhuzhu322 1
  • /Users/heyuan/.pub-cache/hosted/pub.flutter-io.cn/flutter_inappwebview-5.4.3+7/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java:767: 错误: 找不到符号       settings.setAppCachePath(newOptions.appCachePath);

    /Users/heyuan/.pub-cache/hosted/pub.flutter-io.cn/flutter_inappwebview-5.4.3+7/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java:767: 错误: 找不到符号 settings.setAppCachePath(newOptions.appCachePath);

    /Users/heyuan/.pub-cache/hosted/pub.flutter-io.cn/flutter_inappwebview-5.4.3+7/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java:767: 错误: 找不到符号 settings.setAppCachePath(newOptions.appCachePath);

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':flutter_inappwebview:compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

    opened by jijkbird 1
Releases(2.1.0)
Owner
null
A Flutter package to show beautiful animated snackbars directly using overlay

Easily show beautiful snack bars directly using overlays. Create custom snack bars and show them with awesome animations.

Sajad Abdollahi 11 Dec 27, 2022
A sliding up panel widget which can be used to show or hide content, beautiful and simple.

flutter_sliding_up_panel A sliding up panel widget which can be used to show or hide content, beautiful and simple. demo Getting Started dependencies:

null 25 Dec 12, 2022
Global loading widget, which can be used through simple configuration.

load Global loading widget, which can be used through simple configuration. Pure flutter library, not use native code. It is similar to OKToast in use

Caijinglong 35 Nov 4, 2022
Flutter Triple Status Button can use toggle button but in three statuses.

triple_status_button Triple Status Button. Flutter Triple Status Button can use toggle button but in three statuses. Property Description height heigh

MahdiBagjani 2 Nov 13, 2021
Flutter Color Picker Wheel - an easy to use widget which can be heavily customized

Flutter Color Picker Wheel Flutter Color Picker Wheel is an easy to use widget which can be heavily customized. You can use the WheelColorPicker direc

Kexin Lu 35 Oct 4, 2022
Rows_Columns with Child and Children Widget Demo

Rows_Columns with Child and Children Widget Demo A new Flutter project.This project is to show the combination of Rows and Columns and Child and Child

Avinandan Bose 1 Mar 17, 2022
GetX demo Counter with full understanding of State Management, Route Management and SnackBar

GetX demo Counter with full understanding of State Management, Route Management and SnackBar

TAD 1 Apr 4, 2022
A really easy to use flutter toast library

BotToast ?? A really easy to use flutter toast library! Language: English | 中文简体 ?? Overview ?? Online Demo ?? Example ?? Renderings ?? Getting starte

null 719 Dec 28, 2022
A flutter demo app to practice List.generate with ListView.builder

ListView 3 A flutter demo app to practice List.generate with ListView.builder Developer Alexander Sosa (https://www.linkedin.com/in/alexander-sosa-asi

Alexander Sosa 0 Jan 3, 2022
React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.

English | Português Flutter Hooks A Flutter implementation of React hooks: https://medium.com/@dan_abramov/making-sense-of-react-hooks-fdbde8803889 Ho

Remi Rousselet 2.6k Dec 29, 2022