Rename AutoLayoutParams to AutoLayoutRect
This object represents a rect the auto-layout system.
This commit is contained in:
@@ -8,12 +8,12 @@ import 'package:cassowary/cassowary.dart' as al;
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class _MyAutoLayoutDelegate extends AutoLayoutDelegate {
|
||||
AutoLayoutParams p1 = new AutoLayoutParams();
|
||||
AutoLayoutParams p2 = new AutoLayoutParams();
|
||||
AutoLayoutParams p3 = new AutoLayoutParams();
|
||||
AutoLayoutParams p4 = new AutoLayoutParams();
|
||||
AutoLayoutRect p1 = new AutoLayoutRect();
|
||||
AutoLayoutRect p2 = new AutoLayoutRect();
|
||||
AutoLayoutRect p3 = new AutoLayoutRect();
|
||||
AutoLayoutRect p4 = new AutoLayoutRect();
|
||||
|
||||
List<al.Constraint> getConstraints(AutoLayoutParams parent) {
|
||||
List<al.Constraint> getConstraints(AutoLayoutRect parent) {
|
||||
return <al.Constraint>[
|
||||
// Sum of widths of each box must be equal to that of the container
|
||||
parent.width.equals(p1.width + p2.width + p3.width),
|
||||
@@ -58,25 +58,25 @@ class _ColoredBoxesState extends State<ColoredBoxes> {
|
||||
delegate: delegate,
|
||||
children: <Widget>[
|
||||
new AutoLayoutChild(
|
||||
params: delegate.p1,
|
||||
rect: delegate.p1,
|
||||
child: new DecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFFFF0000))
|
||||
)
|
||||
),
|
||||
new AutoLayoutChild(
|
||||
params: delegate.p2,
|
||||
rect: delegate.p2,
|
||||
child: new DecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFF00FF00))
|
||||
)
|
||||
),
|
||||
new AutoLayoutChild(
|
||||
params: delegate.p3,
|
||||
rect: delegate.p3,
|
||||
child: new DecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFF0000FF))
|
||||
)
|
||||
),
|
||||
new AutoLayoutChild(
|
||||
params: delegate.p4,
|
||||
rect: delegate.p4,
|
||||
child: new DecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user