buildContent method

Widget buildContent()

Implementation

Widget buildContent() {
  if (data.messageType == ImMessageType.text.name) {
    return Text(data.messageContent);
  } else if (data.messageType == ImMessageType.image.name) {
    return GestureDetector(
      onTap: () {
        Get.to(() => ComGallery(urls: [data.messageContent]));
      },
      child: ComImage(data.messageContent),
    );
  } else if (data.messageType == ImMessageType.audio.name) {
    return ImMessageAudio(data: data);
  } else if (data.messageType == ImMessageType.video.name) {
    return ImMessageVideo(data.messageContent);
  } else {
    return const Text('未知消息类型');
  }
}