I'm trying to specify a color on the user's name just like Whatsapp's group chat where each user has different name color:
But I don't seem to know how to implement it.
Here is my bubble's code:
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Stack(
overflow: Overflow.visible,
children: <Widget>[
Container(
padding: EdgeInsets.symmetric(horizontal: 12,vertical: 12,),
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 2),
decoration: BoxDecoration(
color: Color(0xFFEEEEEE),
borderRadius: BorderRadius.circular(5),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.70),
child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(name,
style: TextStyle(
color: // This is the color I want to specify on each users
fontWeight: FontWeight.bold
),),
SizedBox(height: 5,),
Text(
message,
style: TextStyle(fontSize: 16, color: Colors.black),
textAlign: TextAlign.left,
),
],
),
),
SizedBox(width: 5,),
],
),
),
Positioned(
left:0,
top: 2,
child: ClipPath(
clipper: TriangleClipper(),
child: Container(
height: 20,
width: 30,
color: showTriangle?Color(0xFFEEEEEE):Colors.transparent,
...
Is there any solution to this?