Environment Variables
This reference covers compile-time DUIT flags. Use it only when the task asks to change unknown-widget behavior, warm-up, inlining, or focus-node override behavior.
All values are compile-time constants resolved through bool.fromEnvironment.
Pass them with --dart-define to flutter run, flutter build, or
flutter test.
Available Variables
duit:throw-on-unspecified-widget-type
- Package:
flutter_duit - Type:
bool - Default:
true - Purpose: when an unknown widget type is encountered, throw an error instead of rendering a fallback empty widget. Keep this enabled in development unless the user explicitly wants permissive fallback behavior.
duit:enable-warm-up
- Package:
duit_kernel - Type:
bool - Default:
false - Purpose: enables attribute warm-up routines that may reduce first-use latency.
duit:prefer-inline
- Package:
duit_kernel - Type:
bool - Default:
true - Purpose: favors inline function strategies where supported. Treat this as advanced performance tuning.
duit:allow-focus-node-override
- Package:
flutter_duit - Type:
bool - Default:
false - Purpose: controls whether binding a
FocusNodemay override an existing node with the samenodeId.
Examples
flutter run -d macos \
--dart-define=duit:throw-on-unspecified-widget-type=false \
--dart-define=duit:enable-warm-up=true \
--dart-define=duit:prefer-inline=trueflutter test \
--dart-define=duit:throw-on-unspecified-widget-type=trueGuardrails
- Do not use runtime environment variables for these flags; they must be passed through the Flutter/Dart toolchain.
- When changing defaults in scripts or CI, update every relevant run/build/test command.
- Mention the chosen flag values in the final response when they affect debugging or production behavior.