Tagged with #widgets

Browse all tags
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