Skip to main content

prefer-sliver-prefix

added in: 1.10.0
Pro+

Warns when a widget that returns a Sliver... widget does not have a Sliver prefix in its name.

Example

❌ Bad:

// LINT: Add a 'Sliver' prefix to the widget that returns a sliver widget.
class MyOtherWidget extends StatelessWidget {
Widget build() {
return SliverWidget();
}
}

✅ Good:

class SliverMyOtherWidget extends StatelessWidget {
Widget build() {
return SliverWidget();
}
}