I was wondering how can (chat bubble) adjust to the size of message sent or received, when it is too long it will have some overflow and get out of the container instead of going to the second line, third line and so on .. , how can I make it make lines when the first line is filled?
child: ChatBubble(
clipper: ChatBubbleClipper6(
nipSize: 0,
radius: 20,
type: BubbleType.receiverBubble,
),
margin: EdgeInsets.only(top:10),
child: Container(
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width *0.6,
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
data['msg'],
style: TextStyle(
fontSize: 15,
),
maxLines: 100,
overflow: TextOverflow.ellipsis,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
data['createdDate'] == null
? DateTime.now().toString()
:data['createdDate']
.toDate().toString(),
],
),
],
),
),
),
CodePudding user response:
Use Expanded to wrap Text
.
A widget that expands a child of a Row, Column, or Flex so that the child fills the available space.