assorted_layout_widgets 11.0.0
assorted_layout_widgets: ^11.0.0 copied to clipboard
Widgets like SideBySide, ColumnSuper, RowSuper, FitHorizontally, Box, WrapSuper, TextOneLine, Delayed, Pad, ButtonBarSuper, NormalizedOverflowBox, showDialogSuper etc.
Sponsored by MyText.ai
11.0.0 #
- Breaking change: The signature of the builders of
TimeBuilderhave been changed. They all now use named parameters, and also get a newinitialTimeparameter that was not present before. Migration should be straightforward, Refer to the README for more information.
10.7.0 #
- The
ScrollShadowwidget adds a shadow at the top and/or bottom, to scrollables likeSingleChildScrollVieworListViewetc., when the content doesn't fit the scrollable's viewport. As the shadow appears only if there is content outside the viewable area, this gives the user an indication if there is more content to be seen or not.
10.6.1 #
-
The
DetectScrollwidget can detect if the content of a Scrollable is larger than the Scrollable itself, which means that the content can be scrolled, and that a scrollbar is likely visible. It can also tell you the probable width of that scrollbar.This is useful for positioning widgets relative to the scrollbar, so that the scrollbar doesn't overlap them. This can be important when the scrollbar is permanently visible, usually on the Web and desktop.
Note that
DetectScrollwill only detect the scrolling of its closest scrollable descendant (a scrollable is aSingleChildScrollView,ListView,GridViewetc). Usually, you'd wrap the scrollable you care about directly with aDetectScroll. For example:DetectScroll( child: SingleChildScrollView( child: Column( ... ... );To get the current scroll state and the scrollbar width, descendants can call:
bool canScroll = DetectScroll.of(context).canScroll; double scrollbarWidth = DetectScroll.of(context).scrollbarWidth;For example, suppose you want to add a help button to the top-right corner of a scrollable, and account for the scrollbar width only if it's visible:
bool canScroll = DetectScroll.of(context).canScroll; double scrollbarWidth = DetectScroll.of(context).scrollbarWidth; return Stack( children: [ child, Positioned( right: canScroll ? scrollbarWidth : 0, top: 0, child: HelpButton(), ), ], );Another alternative is using the optional
onChangecallback of theDetectScroll:DetectScroll( onChange: ({ required bool canScroll, required double scrollbarWidth, }) { // Do something. } child: ... ),
10.5.0 #
- The
SideBySidewidget now has amainAxisSizeproperty the determines whether it will occupy the full available width (MainAxisSize.max) or only as much as it needs (MainAxisSize.min).
10.3.0 #
-
CircleButtonnow accepts an optional custom builder function to modify the button's child widget. This can be used to animate the button when the button is tapped, or when the mouse is over it. For example:CircleButton( icon: Icon(Icons.shopping_cart), builder: ({ required bool isHover, required bool isPressed, required Widget child, }) => AnimatedScale( scale: isPressed ? 0.85 : 1.0, duration: const Duration(milliseconds: 50), child: child, ), );Try running the example.
10.2.4 #
-
SideBySidewidget now allows for any number of children, not just two. Example:SideBySide( children: [ Text("Hello!", textWidthBasis: TextWidthBasis.longestLine), Text("How are you?", textWidthBasis: TextWidthBasis.longestLine), Text("I'm good, thank you.", textWidthBasis: TextWidthBasis.longestLine), ], gaps: [8.0, 12.0], );The
SideBySidewidget achieves layouts that are not possible withRoworRowSuperwidgets. Read the documentation for more information.Deprecated usage: The
startChildandendChildparameters are deprecated. Use thechildrenparameter instead. TheinnerDistanceparameter is also deprecated. Use thegapsparameter instead.For example, this deprecated code:
return SideBySide( startChild: Text("Hello!", textWidthBasis: TextWidthBasis.longestLine), endChild: Text("How are you?", textWidthBasis: TextWidthBasis.longestLine), innerDistance: 8.0, );Should be replaced with:
return SideBySide( children: [ Text("Hello!", textWidthBasis: TextWidthBasis.longestLine), Text("How are you?", textWidthBasis: TextWidthBasis.longestLine), ], gaps: [8.0], );
10.1.2 #
-
The
Boxwidget can now have adecoration, as well as adecorationPosition. Previously, if aContainerhad a decoration you could not replace it with aBox, but now you can. Note theBoxis a little more flexible than theContainerwhen you define acolorand aBoxDecorationor aShapeDecorationat the same time, as theBoxwill only throw an error if thecoloris defined twice. -
You can use
Box.gap()to create a small gap between widgets:Column( children: [ Text('A'), const Box.gap(8), // 8.0 pixel gap Text('B'), ]);
10.0.4 #
- Fixed
GestureDetectorordering issue forRowSuperandColumnSuperwhen theinvertparam istrue.
10.0.3 #
-
Removed
KeyboardDismissdependency ondart:ioto make it compatible with platform web. -
Now
CircleButtoncan specifyhoverColor(default is no color), andcursor(the default isSystemMouseCursors.click, but you can passnullto set it asMouseCursor.defer.
9.0.2 #
- Added
Pad.addValuesandPad.subtractValues.
9.0.1 #
- Flutter 3.16.0 compatible.
8.0.5 #
- const WrapSuper.
8.0.4 #
- Removed deprecated
TextOneLineEllipsisWithFadewidget. Please useTextOneLineinstead.
7.0.1 #
- Fixed letter-spacing for TextOneLine, whe the style is defined inline.
7.0.0 #
-
Flutter 3.3.0 (Dart 2.18.0).
-
TextOneLineEllipsisWithFadedeprecated. Please useTextOneLineinstead.
6.1.1 #
KeyboardDismiss.
6.0.0 #
- Flutter 3.0.
5.8.5 #
NonUniformOutlineInputBorderandNonUniformRoundedRectangleBorderwidgets.
5.7.1 #
CaptureGestureswidget.
5.6.1 #
ButtonandCircleButtonwidgets.
5.5.0 #
SideBySidewidget.
5.4.1 #
MaskFunctionTextInputFormatterinput formatter (forTextwidgets).
5.3.0-dev0 #
ColumnSuperparameter:removeChildrenWithNoHeight. See this example.
5.2.1 #
GlobalValueKeyandGlobalStringKey.
5.1.3 #
- Upgrade to Flutter 2.5.1
5.1.1 #
- Fixed alignment bug in
RowSuperwhenfill: trueandMainAxisSize.maxandAlignment.center.
5.1.0 #
TimeBuilderwidget.
5.0.3 #
-
Box.copyWith()method. -
Now
Boxcan be changed by using theoperator +. For example, to hide the box:Box(...) + false;. To change the box color:Box(...) + Colors.green;. To change the box padding:Box(...) + Pad(all: 10);. To substitute the box child:Box(...) + Text('abc');. To put a box inside of another:Box(...) + Box(...);.
5.0.2 #
- Now
TextOneLineis more similar to the nativeTextwidget, in preparation for when https://github.com/flutter/flutter/issues/18761 is fixed. You probably won't notice the difference and may continue using it as usual.
5.0.1 #
-
showCupertinoDialogSuper. -
The
onDismissedcallback parameter forshowDialogSuperis called when the dialog is dismissed. That's still the case, but now that callback gets theresultof the dialog, when the dialog is popped byNavigator.of(context).pop(result). That way you can differentiate between the dialog being dismissed by an Ok or a Cancel button, for example. Noteresultisnullwhen the dialog is dismissed by tapping the barrier or pressing BACK in Android. Example:showDialogSuper<int>( ... actions: [ ElevatedButton( onPressed: (){Navigator.pop(context, 1);}, child: const Text("OK"), ElevatedButton( onPressed: (){Navigator.pop(context, 2);}, child: const Text("CANCEL"), ] ... onDismissed: (int? result) { if (result == 1) print("Pressed the OK button."); else if (result == 2) print("Pressed the CANCEL button."); else if (result == null) print("Dismissed with BACK or tapping the barrier."); });
4.0.10 #
- Fixed bug in
WrapSuperintrinsic height.
4.0.9 #
showDialogSupermethod is identical to the nativeshowDialog, except that it lets you define a callback for when the dialog is dismissed.
4.0.8 #
- Fixed important bug in
FitHorizontallywidget (andRowSuperwhen using thefitHorizontallyparameter).
4.0.7 #
NormalizedOverflowBoxwidget.
4.0.5 #
WrapSuper.wrapFitparameter.ButtonBarSuperparameter.- New examples: WrapSuper WrapFit Example and ButtonBarSuper Example
4.0.2 #
Pad.copyWith().
4.0.1 #
- Fixed NNBD problem:
TextOneLineas child of an intrinsic size widget.
4.0.0 #
- Nullsafety.
RowSuperhorizontal alignment now applied when there are noRowSpacers andMainAxisSizeismax.
3.0.1 #
-
Breaking change: The
Boxwidget now has apaddingparameter. I recommend you use it with the newPadclass. For example:Box(padding: Pad(top: 4.0)). ThePadclass solves the verbosity problem, and having apaddingparameter makesBoxmore compatible withContainer( rememberBoxis like aContainerwhich can be madeconst, so it's best if their parameters are not too different). -
The debugging constructors of the
Boxwidget are now marked as deprecated so that you don't forget to remove them (they are not really deprecated).
2.0.1 #
Padclass.
2.0.0 #
- Support for Flutter 1.22.
1.3.6 #
- Docs improvement.
- Fixed edge case for
RowSuper.
1.3.4 #
- Docs improvement.
1.3.3 #
- RowSuper:
fillparameter.
1.3.2 #
Delayedwidget.
1.2.0 #
- Breaking Change:
ColumnSuperwidth is now the max intrinsic width of its children, just like a regularColumn. To restore old behavior:Container(width: double.infinity, child: ColumnSuper(...)). - Breaking Change:
RowSuperheight is now the max intrinsic height of its children, just like a regularRow. To restore old behavior:Container(height: double.infinity, child: RowSuper(...)). - New examples: ColumnSuper Playground and RowSuper Playground.
1.1.4 #
- Fix:
ColumnSuperintrinsic height, andRowSuperintrinsic width.
1.1.3 #
- Fix:
WrapSuperminimum raggedness algorithm now uses the correct JavaScript'sNumber.MAX_SAFE_INTEGER. - Fix: Divide by zero conditions.
1.1.1 #
- Docs improvement.
1.1.0 #
- Upgraded to Flutter 1.17.
1.0.18 #
WrapSuper.
1.0.15 #
- Box now has
verticalandhorizontalas constructor parameters.
1.0.14 #
TextOneLinethat fixes https://github.com/flutter/flutter/issues/18761.
1.0.13 #
- Alignment fix.
1.0.12 #
Box.
1.0.10 #
FitHorizontallywidget.RowSpacerwidget.
1.0.0 #
RowSuperandColumnSuperwidgets.
