CompatibilityPolicy enum
Defines how strictly the compatibility engine evaluates template constraints.
Policies control:
- Which axes are evaluated (e.g., skip platform check in permissive mode).
- Whether warnings are upgraded to errors (strict/release mode).
- Whether Flutter SDK checks are enforced for dart-only templates.
Policy Hierarchy (strictness ascending)
permissive → standard → strict → release
- Permissive: Only evaluate Dart SDK; skip platform/capability/dependency checks. Suitable for exploration and templates that have not yet declared all constraints.
- Standard: Evaluate Dart SDK, Flutter SDK (when required), and project
type. Skip platform and capability checks. Warnings remain warnings. This
is the default policy for
fps createand catalog browsing. - Strict: Evaluate all axes including platforms, capabilities, and dependencies. Warnings remain warnings. Used for pre-release validation.
- Release: Same as strict but all warnings are promoted to errors. Used for publishing gate checks.
- Inheritance
- Available extensions
Values
- permissive → const CompatibilityPolicy
-
Only check Dart SDK constraint. Skip all other axes.
- standard → const CompatibilityPolicy
-
Check Dart SDK, Flutter SDK, and project type. Default policy.
- strict → const CompatibilityPolicy
-
Check all axes (Dart, Flutter, platform, project type, capabilities, dependencies). Warnings remain warnings.
- release → const CompatibilityPolicy
-
Same as strict but warnings are promoted to errors.
Properties
- checksCapabilities → bool
-
Available on CompatibilityPolicy, provided by the CompatibilityPolicyX extension
Whether capability requirements are evaluated.no setter - checksDartSdk → bool
-
Available on CompatibilityPolicy, provided by the CompatibilityPolicyX extension
Whether the Dart SDK axis is evaluated under this policy. Always true for all policies.no setter - checksDependencies → bool
-
Available on CompatibilityPolicy, provided by the CompatibilityPolicyX extension
Whether dependency compatibility is evaluated.no setter - checksFlutterSdk → bool
-
Available on CompatibilityPolicy, provided by the CompatibilityPolicyX extension
Whether the Flutter SDK axis is evaluated under this policy.no setter - checksPlatforms → bool
-
Available on CompatibilityPolicy, provided by the CompatibilityPolicyX extension
Whether platform compatibility is evaluated.no setter - checksProjectType → bool
-
Available on CompatibilityPolicy, provided by the CompatibilityPolicyX extension
Whether the project type axis is evaluated.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- warningsAreErrors → bool
-
Available on CompatibilityPolicy, provided by the CompatibilityPolicyX extension
Whether warnings are promoted to errors under this policy.no setter
Methods
-
applyPromotions(
List< CompatibilityIssue> issues) → List<CompatibilityIssue> -
Available on CompatibilityPolicy, provided by the CompatibilityPolicyX extension
Applies this policy's promotion rules to an issue list. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
CompatibilityPolicy> - A constant List of the values in this enum, in order of their declaration.