Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. // This is a modified excerpt from Flutter library source code
  2.  
  3. // We have a class called EdgeInsets
  4.  
  5. class EdgeInsets extends EdgeInsetsGeometry {
  6. // The first constructor
  7. const EdgeInsets.fromLTRB(this.left, this.top, this.right, this.bottom);
  8. // The second constrctor
  9. // Notice: There's a colon following the signature, which resembles the form in C++
  10. const EdgeInsets.all(double value)
  11. : left = value,
  12. top = value,
  13. right = value,
  14. bottom = value;
  15. // The third constructor
  16. // Notice: how named arguments are used
  17. const EdgeInsets.only({
  18. this.left = 0.0,
  19. this.top = 0.0,
  20. this.right = 0.0,
  21. this.bottom = 0.0,
  22. });
  23. // .....
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement