WidgetExtension extension
Chainable shortcuts for wrapping a widget in common layout widgets.
Instead of nesting a widget inside Padding, SizedBox, Center and so on, call the matching method on it:
Word('Hello')
.paddingAll(8)
.center()
.withTooltip(msg: 'Greeting');
- on
Properties
- makeRefreshable → Widget
-
Available on Widget?, provided by the WidgetExtension extension
Places an empty ListView behind this widget so a RefreshIndicator can be used with content that doesn't scroll on its own.no setter
Methods
-
center(
{double? heightFactor, double? widthFactor}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Centres this widget in the available space. -
cornerRadiusWithClipRRect(
double radius) → ClipRRect -
Available on Widget?, provided by the WidgetExtension extension
Clips this widget to a rectangle with all corners rounded byradius. -
cornerRadiusWithClipRRectOnly(
{int bottomLeft = 0, int bottomRight = 0, int topLeft = 0, int topRight = 0}) → ClipRRect -
Available on Widget?, provided by the WidgetExtension extension
Clips this widget to a rectangle with a different radius on each corner. Corners you leave out stay square. -
expand(
{int flex = 1}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Wraps this widget in an Expanded so it fills the remaining space in a Row, Column or Flex. -
fit(
{BoxFit? fit, AlignmentGeometry? alignment}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Scales this widget to fit its parent with a FittedBox. -
flexible(
{int flex = 1, FlexFit? fit}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Wraps this widget in a Flexible inside a Row, Column or Flex. -
opacity(
{required double opacity, int durationInSecond = 1, Duration? duration}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Fades this widget toopacity, from 0.0 (invisible) to 1.0 (fully visible). -
paddingAll(
double padding) → Padding -
Available on Widget?, provided by the WidgetExtension extension
Adds the samepaddingon all four sides of this widget. -
paddingBottom(
double bottom) → Padding -
Available on Widget?, provided by the WidgetExtension extension
Addsbottomlogical pixels of padding below this widget. -
paddingDirectional(
{double start = 0.0, double top = 0.0, double end = 0.0, double bottom = 0.0}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Adds padding that follows the reading direction. -
paddingLeft(
double left) → Padding -
Available on Widget?, provided by the WidgetExtension extension
Addsleftlogical pixels of padding to the left of this widget. -
paddingOnly(
{double top = 0.0, double left = 0.0, double bottom = 0.0, double right = 0.0}) → Padding -
Available on Widget?, provided by the WidgetExtension extension
Adds padding to any combination of sides. Sides you leave out get none. -
paddingRight(
double right) → Padding -
Available on Widget?, provided by the WidgetExtension extension
Addsrightlogical pixels of padding to the right of this widget. -
paddingSymmetric(
{double vertical = 0.0, double horizontal = 0.0}) → Padding -
Available on Widget?, provided by the WidgetExtension extension
Addsverticalpadding above and below, andhorizontalpadding on the left and right. -
paddingTop(
double top) → Padding -
Available on Widget?, provided by the WidgetExtension extension
Addstoplogical pixels of padding above this widget. -
rotate(
{required double angle, bool transformHitTests = true, Offset? origin}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Rotates this widget byangleradians clockwise. -
scale(
{required double scale, Offset? origin, AlignmentGeometry? alignment, bool transformHitTests = true}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Scales this widget byscale, where 1.0 is its normal size. -
tooltip(
{required String msg}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Showsmsgin a tooltip when this widget is hovered or long-pressed. -
translate(
{required Offset offset, bool transformHitTests = true, Key? key}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Moves this widget byoffsetwithout affecting the layout around it. -
validate(
{Widget value = const SizedBox()}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Returns this widget, orvalueif this widget is null. -
visible(
bool visible, {Widget? defaultWidget}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Shows this widget whenvisibleis true, otherwisedefaultWidget. -
withHeight(
double height) → SizedBox -
Available on Widget?, provided by the WidgetExtension extension
Wraps this widget in a SizedBox with a fixedheight. -
withShaderMask(
List< Color> colors, {BlendMode blendMode = BlendMode.srcATop}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Paints a left-to-right gradient ofcolorsover this widget. -
withShaderMaskGradient(
Gradient gradient, {BlendMode blendMode = BlendMode.srcATop}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Paintsgradientover this widget. -
withSize(
{double width = 0.0, double height = 0.0}) → SizedBox -
Available on Widget?, provided by the WidgetExtension extension
Wraps this widget in a SizedBox of the givenwidthandheight. -
withTooltip(
{required String msg}) → Widget -
Available on Widget?, provided by the WidgetExtension extension
Showsmsgin a tooltip when this widget is hovered or long-pressed. -
withVisibility(
bool visible, {Widget? replacement, bool maintainAnimation = false, bool maintainState = false, bool maintainSize = false, bool maintainSemantics = false, bool maintainInteractivity = false}) → Visibility -
Available on Widget?, provided by the WidgetExtension extension
Wraps this widget in a Visibility. -
withWidth(
double width) → SizedBox -
Available on Widget?, provided by the WidgetExtension extension
Wraps this widget in a SizedBox with a fixedwidth.