I was wondering if anyone can help me try to figure out how to make the chat boxes responsive based on the text. As seen below in the picture. How the chat bubbles are supposed to look
Below is the code to attempt to make the chat bubble. I don't mind changing widget type to achieve the container fitting o the size of the text. I just do not want compromise the design. I can also include other attempts in the comments if needed! Thanks for the help in advance.
return Container(
child: Padding(
padding: EdgeInsets.only(left:5),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left:10),
child: new CircleAvatar(
radius: (17.5),
backgroundImage: AssetImage(
user.profilePic,),
),
),
SizedBox(width: 10,),
Container(
width: MediaQuery.of(context).size.width,
constraints: BoxConstraints(//minWidth:125,
maxWidth: 290, //275
),
child:Material(
//color:Color(0x00000000) , TRANSPARENT
color:const Color(0xf2ffffff),///Color(0xe6ffffff) // ! REVISIT Change color of boxes???
borderRadius: BorderRadius.only(
topRight: Radius.circular(16.0),
bottomRight: Radius.circular(16.0),
bottomLeft: Radius.circular(16.0),
),
child: Padding(
padding: const EdgeInsets.only(left:10.0), //Revisit
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 5,),
Row(
children: [
Text(user.name, ///0xd9343f4b
style: TextStyle(
fontFamily: 'Lato',
fontSize: (13/8.12)*SizeConfig.textMultiplier,
color: const Color(0xd9343f4b),
fontWeight: FontWeight.w700,
),
textAlign: TextAlign.left,),
SizedBox(width:8),
Text(message.time,
style: TextStyle(
fontFamily: 'Lato',
fontSize: 10,
color: const Color(0xd9343f4b),
),
textAlign: TextAlign.left,
),
],
),
SizedBox(height: 5,),
Container(
margin: EdgeInsets.only( right:10,),
child: Text(message.text,
style: TextStyle(
fontFamily: 'Lato',
fontSize: 13,
color: const Color(0xd9343f4b),
),
textAlign: TextAlign.left,
),
),
//SizedBox(height: 10,),//if(message.imageUrl!='') {
SizedBox(height: 10,),
_isPhoto(message),
//},
//}
],
),
),
),
),
],
),
)
);
} ```
