Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a modified excerpt from Flutter library source code
- // We have a class called EdgeInsets
- class EdgeInsets extends EdgeInsetsGeometry {
- // The first constructor
- const EdgeInsets.fromLTRB(this.left, this.top, this.right, this.bottom);
- // The second constrctor
- // Notice: There's a colon following the signature, which resembles the form in C++
- const EdgeInsets.all(double value)
- : left = value,
- top = value,
- right = value,
- bottom = value;
- // The third constructor
- // Notice: how named arguments are used
- const EdgeInsets.only({
- this.left = 0.0,
- this.top = 0.0,
- this.right = 0.0,
- this.bottom = 0.0,
- });
- // .....
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement