Domains

Domains group rules by the framework they apply to. Toggle a whole domain in falcon.json under linter.domains — see the configuration reference.

flutter

Rules that only make sense in a Flutter project — widget construction, lifecycle, and framework APIs. Enable the domain to turn them all on at once. 23 rules.

avoid-printrec

Flags calls to the top-level `print` function.

avoid-returning-widgetsrec

Disallow functions and methods that return a `Widget`.

avoid-single-child-column-or-rowrec

Flags a `Column`, `Row`, or `Flex` widget built with a single child.

avoid-unnecessary-containersrec

Flags a `Container` whose only argument is a `child`.

avoid-web-libraries-in-flutterrec

Disallow importing web-only `dart:` libraries from Flutter code.

correct-order-for-super-disposerec

Require `super.dispose()` to be the last call in `dispose`.

no-logic-in-create-staterec

Require `createState` to do nothing but return a new `State` instance.

prefer-async-callbackrec

Flags the type `Future<void> Function()` in favor of Flutter's `AsyncCallback`.

prefer-const-border-radiusrec

Flags `BorderRadius.only(...)` whose four corner radii are all equal.

prefer-correct-edge-insets-constructorrec

Flags an `EdgeInsets.only(...)` that a more specific constructor expresses better.

prefer-declaring-const-constructorrec

Flags a constructor that could be declared `const` but is not.

prefer-dedicated-media-query-methodsrec

Flags `MediaQuery.of(context).size` access in favor of `MediaQuery.sizeOf`.

prefer-extracting-callbacksrec

Flags an inline block-body callback passed to a widget constructor that should be extracted to a method.

proper-controller-disposerec

Require controllers owned by a `State` to be disposed.

proper-expanded-and-flexiblerec

Require `Expanded` and `Flexible` to sit directly inside a flex widget.

proper-super-init-staterec

Require `super.initState()` to be the first call in `initState`.

sized-box-for-whitespacerec

Flags a `Container` used only to add fixed `width`/`height` whitespace.

sort-child-properties-lastrec

Flags a `child` or `children` argument that is not the last named argument in a widget constructor call.

unnecessary-flutter-importsrec

Disallow Flutter framework imports that the file does not use.

use-design-system-itemrec

Flags construction of a widget or type that should be replaced by its design-system equivalent.

use-full-hex-values-for-flutter-colorsrec

Flags a `Color` constructed from a hexadecimal literal with fewer than eight digits.

use-once-constructors-once-providerrec

Require Riverpod once-providers to be created through `.once()`.

use-spacer-as-expanded-childrec

Flags an `Expanded` wrapping an empty `SizedBox` or `Container` that should be a `Spacer`.