Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Modify the build() method for the ChatMessage class as follows.
- class ChatMessage extends StatelessWidget {
- ChatMessage({this.text, this.animationController});
- final String text;
- final AnimationController animationController;
- @override
- Widget build(BuildContext context) {
- return new SizeTransition( //new
- sizeFactor: new CurvedAnimation( //new
- parent: animationController, curve: Curves.easeOut), //new
- axisAlignment: 0.0, //new
- child: new Container( //modified
- margin: const EdgeInsets.symmetric(vertical: 10.0),
- child: new Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- new Container(
- margin: const EdgeInsets.only(right: 16.0),
- child: new CircleAvatar(child: new Text(_name[0])),
- ),
- new Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- new Text(_name, style: Theme.of(context).textTheme.subhead),
- new Container(
- margin: const EdgeInsets.only(top: 5.0),
- child: new Text(text),
- ),
- ],
- ),
- ],
- ),
- ) //new
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement