WidgetExtension extension
The WidgetExtension extension is an extension on the Widget class in Flutter.
It allows for additional functionality to be added to any widget through the use of dot notation
- on
Methods
-
expand(
[int flex = 1]) → Expanded - Creates an Expanded widget with the current widget as its child
-
flexible(
[int flex = 1, FlexFit fit = FlexFit.loose]) → Flexible - Creates a Flexible widget with the current widget as its child
-
hBox(
double height) → SizedBox - Creates a SizedBox widget with the current widget as its child and sets its height
-
hide(
bool isVisible, {bool maintainSize = false}) → Visibility - Creates a Visibility widget with the current widget as its child and sets its visibility based on the passed condition
-
positioned(
{double? top, double? bottom, double? left, double? right, double? height, double? width}) → Positioned -
Creates a Positioned widget with the current widget as its child.
Only two out of the three horizontal values (
left
,right
,width
), and only two out of the three vertical values (top
,bottom
,height
), can be set. In each case, at least one of the three must be null. -
show(
bool isVisible, {bool maintainSize = false}) → Visibility - Creates a Visibility widget with the current widget as its child and sets its visibility based on the passed condition
-
sizedBox(
{double? h, double? w}) → SizedBox - Creates a SizedBox widget with the current widget as its child and sets its height and width
-
sqBox(
double size) → SizedBox - Creates a square shaped SizedBox widget with the current widget as its child and sets its height and width
-
wBox(
double? width) → SizedBox - Creates a SizedBox widget with the current widget as its child and sets its width