This is a single row for a chat message in a group chat. I need it to look like this:
(circular area for a small icon) username
(empty space below icon) message
(empty space below icon) timestamp (when message is clicked on)
The circular area is going to hold any one of a set of image assets from assets/profileIcons
. I tried to simulate the circular area (temporarily) using the code below, but the icon doesn’t show up no matter what color I pick. All I see is a white space there. Also, the username is not neatly lining up with the message field. I’m so confused. I wish there was a way to build this with a GUI because the cascading child
s of a widget is really annoying to read.
return Column(
children: [
Row(
children: [
Expanded(flex: 5,
child: Container(
margin: EdgeInsets.all(50.0),
decoration: BoxDecoration(
color: Colors.red,
shape: BoxShape.circle
),
)
),
Expanded(flex: 8, child: Text(username)),
Expanded(flex: 15, child: Text('')),
],
),
Row(
children: [
SizedBox(width: 20,),
Container(
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.5),
padding: EdgeInsets.only(left: 15, top: 15, right: 15, bottom: 15),
decoration: BoxDecoration(
color: Color.fromRGBO(66, 135, 245, 100.0),
borderRadius: BorderRadius.circular(30),
),
child: Wrap(
children: [
Text(text),
],
),
),
],
),
],
);
2
Answers
Heading ##listtile ##leading ##chat ## return Scaffold(
Try this! I hope this answer is helpful to you.
.
As per your requirement, when you tap on a particular message date is shown below the message.
.
View Output