Guest User

Untitled

a guest
Aug 18th, 2019
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Modify the build() method for the ChatMessage class as follows.
  2.  
  3. class ChatMessage extends StatelessWidget {
  4. ChatMessage({this.text, this.animationController});
  5. final String text;
  6. final AnimationController animationController;
  7. @override
  8. Widget build(BuildContext context) {
  9. return new SizeTransition( //new
  10. sizeFactor: new CurvedAnimation( //new
  11. parent: animationController, curve: Curves.easeOut), //new
  12. axisAlignment: 0.0, //new
  13. child: new Container( //modified
  14. margin: const EdgeInsets.symmetric(vertical: 10.0),
  15. child: new Row(
  16. crossAxisAlignment: CrossAxisAlignment.start,
  17. children: <Widget>[
  18. new Container(
  19. margin: const EdgeInsets.only(right: 16.0),
  20. child: new CircleAvatar(child: new Text(_name[0])),
  21. ),
  22. new Column(
  23. crossAxisAlignment: CrossAxisAlignment.start,
  24. children: <Widget>[
  25. new Text(_name, style: Theme.of(context).textTheme.subhead),
  26. new Container(
  27. margin: const EdgeInsets.only(top: 5.0),
  28. child: new Text(text),
  29. ),
  30. ],
  31. ),
  32. ],
  33. ),
  34. ) //new
  35. );
  36. }
  37. }
RAW Paste Data