Skip to content

Instantly share code, notes, and snippets.

@aneury1
Created June 9, 2020 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aneury1/3f2cc000af1f6dc4e1dbdba61571fd6e to your computer and use it in GitHub Desktop.
Save aneury1/3f2cc000af1f6dc4e1dbdba61571fd6e to your computer and use it in GitHub Desktop.
getTextContent(context, text){
return Row(
mainAxisAlignment: MainAxisAlignment.start,
//this will determine if the message should be displayed left or right
children: [
Flexible(
//Wrapping the container with flexible widget
child: Container(
padding: EdgeInsets.all(8.0),
margin: EdgeInsets.all(4.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8.0))),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Flexible(
//We only want to wrap the text message with flexible widget
child: Container(
child: Text(
text,
)
)
),
SizedBox(
width: 8.0,
),
/* Padding(
padding: EdgeInsets.only(top: 6.0),
child: Text(
message.time,
style: TextStyle(fontSize: 10.0, color: Colors.grey),
),
),*/
SizedBox(
width: 8.0,
),
/*Padding(
padding: EdgeInsets.only(top: 6.0),
child: Text(
message.author,
style: TextStyle(fontSize: 10.0, color: Colors.grey),
),
),*/
],
)),
)
]
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment