Stylish Text with ShaderMask and LinearGradient
1 min read
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.
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.
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.
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.
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.
If you need to return an empty widget, SizedBox.shrink() is more performant than an empty Container.
In Flutter you can use DecoratedBox to set a lot of decoration/styling options to your widgets. Here's how.
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, including reusing the same style across all buttons with ThemeData.