1 Align

In other developments, Align is generally treated as a control property, not as a separate control. The function of Align itself is not complicated. Set the alignment mode of child, such as center, left to right, etc., and adjust its own size according to the size of child.

2. Constructors

Align({
    Key key,
    this.alignment = Alignment.center,
    this.widthFactor,
    this.heightFactor,
    Widget child,
})
Copy the code

3 Common Attributes

3.1 Alignment: Alignment

alignment:Alignment.topLeft,
Copy the code

3.1.1 Top left

alignment:Alignment.topLeft,
Copy the code

3.1.2 Top middle

alignment:Alignment.topCenter,
Copy the code

3.1.3 Top right

alignment:Alignment.topRight,
Copy the code

3.1.4 Middle left

alignment:Alignment.centerLeft,
Copy the code

3.1.5 Middle

alignment:Alignment.center,
Copy the code

3.1.6 Middle right

alignment:Alignment.centerRight,
Copy the code

3.1.7 Bottom left

alignment:Alignment.bottomLeft,
Copy the code

3.1.8 Bottom middle

alignment:Alignment.bottomCenter,
Copy the code

3.1.9 Bottom right

alignment:Alignment.bottomRight,
Copy the code

3.2 widthFactor: width

Width factor. If not set, the width of Align is match_parent; If not null, the width of the container is set to the width of the child Widget multiplied by this width factor

Value must be > = 0

3.3 heightFactor: Height

Height factor. If not, the height of Align is match_parent; If not null, the height of the container is set to the height of the child widgets multiplied by this height factor

Value must be > = 0

3.4 Child: child widget

Child: Text(' hello Flutter'),Copy the code

For more information

For more information, please pay attention to youth Code farmers.