buildContent method

Widget buildContent()

Implementation

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