Center Widget
Overview
This widget places its child at its center. The height and width of the widget can be adjusted using the Width Factor and Height Factor. Accommodates a single child. However, you may add a layout widget as a child that accommodates multiple child widgets.
Use Cases
- Whenever the child widget needs to be centrally aligned to the parent, the Center widget is useful.
- Child widget can be easily placed at the center.
Properties
- The widget's width will be the product of the child width and the
Width Factor
. So, if the width factor is 2.0, the width of the widget will be twice of child's width. - The widget's height will be the product of the child width and the
Height factor
. So, if the height factor is 1.0, the height of the widget will be the same as the child's height.