receiverTextMessageWidget method

Widget receiverTextMessageWidget(
  1. BuildContext context,
  2. String text
)

Implementation

Widget receiverTextMessageWidget(BuildContext context, String text) {
  final isDark = Theme.of(context).brightness == Brightness.dark;

  return Container(
    padding: const EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 5),
    decoration: BoxDecoration(
      color: isDark ? Colors.black26 : Colors.blueGrey[100],
      borderRadius: const BorderRadius.only(
        topRight: Radius.circular(17),
        bottomRight: Radius.circular(17),
        topLeft: Radius.circular(17),
      ),
      border: Border.all(color: Colors.black12),
    ),
    child: AutoDirection(
      text: text,
      child: ReadMoreText(
        text,
        trimLines: 5,
        trimMode: TrimMode.line,
        trimCollapsedText:
            VChatAppService.instance.getTrans(context).showMore(),
        trimExpandedText:
            VChatAppService.instance.getTrans(context).showLess(),
        moreStyle: Theme.of(context)
            .textTheme
            .bodyText1!
            .copyWith(fontWeight: FontWeight.bold),
        style: Theme.of(context).textTheme.bodyText1,
      ),
    ),
  );
}