33 lines
956 B
Dart
33 lines
956 B
Dart
import 'package:chat/configs/app_colors.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:tencent_im_sdk_plugin/models/v2_tim_message.dart';
|
|
|
|
class ShowTextMessage extends StatelessWidget {
|
|
final V2TimMessage message;
|
|
const ShowTextMessage(this.message, {Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
constraints: BoxConstraints(
|
|
maxWidth: Get.width - 128,
|
|
minHeight: 43,
|
|
),
|
|
padding: const EdgeInsets.all(12),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(4),
|
|
color: message.isSelf! ? AppColors.primary : AppColors.white,
|
|
),
|
|
child: Text(
|
|
message.textElem!.text!,
|
|
overflow: TextOverflow.visible,
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: message.isSelf! ? AppColors.white : AppColors.active,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|