Tagged with #widgets

Browse all tags
The ListWheelScrollView Widget

The ListWheelScrollView Widget

#dart
#flutter
#widgets

If you need to select between a small list of values but have limited vertical space, you can use a ListWheelScrollView.

Text Style with Tabular Figures

Text Style with Tabular Figures

#dart
#flutter
#widgets

If you want to render fixed width (monospaced) digits, set FontFeature.tabularFigures() inside your TextStyle.

New Spacing Argument in Row/Column (Flutter 3.27)

New Spacing Argument in Row/Column (Flutter 3.27)

#dart
#flutter
#widgets
#layouts

Since Flutter 3.27, you can pass a spacing argument to your Row and Column widgets (rather than using SizedBox).

The Banner Widget

The Banner Widget

#dart
#flutter
#widgets

You can use the Banner widget to place a small diagonal banner over a child widget. For more custom styling, build your own using a custom painter.

Stylish Text with ShaderMask and LinearGradient

Stylish Text with ShaderMask and LinearGradient

#dart
#flutter
#widgets

To create a stylish Text, use the ShaderMask widget with a shaderCallback that returns a LinearGradient with begin and end points, along with a list of colors.

How to add a Badge to an IconButton

How to add a Badge to an IconButton

#dart
#flutter
#widgets

The easiest way to add a badge to an IconButton is to use the Badge widget. Use this to show a numeric value or a custom label next to an icon.

The CarouselView Widget

The CarouselView Widget

#dart
#flutter
#layouts
#widgets

Since Flutter 3.24, a new CarouselView widget is available. You can set the children's size with itemExtent and shrinkExtent, and use it with any widgets as children.

The OverflowBar Widget

The OverflowBar Widget

#dart
#flutter
#layouts
#widgets

OverflowBar makes it easy to layout your widgets in a row unless they overflow the available horizontal space, in which case they're arranged as a column.

Use SizedBox.shrink() to return an empty box

Use SizedBox.shrink() to return an empty box

#dart
#flutter
#widgets
#layouts

If you need to return an empty widget, SizedBox.shrink() is more performant than an empty Container.

Use DecoratedBox to add Rounded Borders to a Widget in Flutter

Use DecoratedBox to add Rounded Borders to a Widget in Flutter

#dart
#flutter
#widgets

In Flutter you can use DecoratedBox to set a lot of decoration/styling options to your widgets. Here's how.

How to replace SizedBox with compile-time constants for better performance

How to replace SizedBox with compile-time constants for better performance

#dart
#flutter
#layouts
#widgets

A useful tip to write more performant code when using SizedBox as a gap between widgets inside a Row or Column layout.

How to style an ElevatedButton in Flutter

How to style an ElevatedButton in Flutter

#dart
#flutter
#widgets

How to style an ElevatedButton in Flutter, including reusing the same style across all buttons with ThemeData.

Browse all tags