WidgetExxension extension
A set of extension methods for the Widget class in Flutter.
- on
Methods
-
align(
{Alignment alignment = Alignment.center}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Wrap the widget with an Align widget to control alignment. If no alignment is provided, it defaults toAlignment.center. -
bordered(
{Color borderColor = Colors.black, double borderWidth = 1.0}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a border around the widget with optional border color and width. If no color or width is provided, it defaults to black and 1.0 respectively. -
center(
) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a center widget around the widget. This centers the widget within its parent. -
clipRRect(
{BorderRadiusGeometry? borderRadius}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a clipRRect around the widget with an optional border radius. If no border radius is provided, it defaults to zero. -
column(
{MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a column widget around the widget with optional alignment. If no alignment is provided, it defaults toMainAxisAlignment.startandCrossAxisAlignment.start. -
container(
{Color? color}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a container around the widget with an optional color. If no color is provided, it defaults to transparent. -
expanded(
{int? flex}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a expanded widget around the widget with an optional flex value. If no flex value is provided, it defaults to 1. -
fittedBox(
{BoxFit? fit}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Wrap the widget with a FittedBox to scale and position it within its parent. If no fit is provided, it defaults toBoxFit.contain. -
flexible(
{int? flex}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a flexible widget around the widget with an optional flex value. If no flex value is provided, it defaults to 1. -
gestureDetector(
{void onTap()?, void onDoubleTap()?, void onLongPress()?}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Wrap the widget with a GestureDetector to detect gestures like taps and long presses. If no gestures are provided, it defaults to a no-op. -
hero(
String tag) → Widget -
Available on Widget, provided by the WidgetExxension extension
Wrap the widget with a Hero widget for animated screen transitions. If no tag is provided, it defaults to an empty string. -
margin(
EdgeInsetsGeometry? margin) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a margin around the widget. If no margin is provided, it defaults to zero. -
onTap(
void onTap()?) → Widget -
Available on Widget, provided by the WidgetExxension extension
Wrap the widget with an InkWell to make it tappable. If no onTap callback is provided, it defaults to a no-op. -
opacity(
double? opacity) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a opacity around the widget with an optional opacity value. If opacity is null or invalid, it defaults to 0 (fully transparent). -
padding(
EdgeInsetsGeometry? padding) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a padding around the widget. If no padding is provided, it defaults to zero. -
rotate(
double? angle) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a rotate widget around the widget with an optional angle value. If angle is null or invalid, it defaults to 0.0 (no rotation). -
row(
{MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a row widget around the widget with optional alignment. If no alignment is provided, it defaults toMainAxisAlignment.startandCrossAxisAlignment.start. -
scale(
double? scale) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a scale widget around the widget with an optional scale value. If scale is null or invalid, it defaults to 1.0 (no scaling). -
sizedBox(
{double? width, double? height}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a sizedBox around the widget with optional width and height. If no width or height is provided, it defaults to zero. -
transform(
Matrix4? transform) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a transform widget around the widget with an optional transform value. If transform is null or invalid, it defaults to an identity matrix. -
translate(
{double? x, double? y}) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a translate widget around the widget with optional x and y values. If x or y is null or invalid, it defaults to 0.0 (no translation). -
visibility(
bool? visible) → Widget -
Available on Widget, provided by the WidgetExxension extension
Add a visibility widget around the widget with an optional visible value. If visible is null or invalid, it defaults to true (visible).