Skip to main content

Number of Used Widgets

The number of widgets used inside a build method.

Large number of used widgets is complex to read and maintain. It's recommended to keep widgets as small as possible.

A recommended NUW is 20 or less.

Config example

dart_code_metrics:
...
metrics:
...
number-of-used-widgets: 20
...