Flutter
Presentation and runtime context
Detect Flutter build mode, collect bounded framework facts, and delegate user-facing UI through the root Navigator.
Presentation and runtime context
FlutterErrorBuildMode.detect() maps Flutter compile-time constants to debug, profile, or release. FlutterErrorBuildMode.environment(...) combines that result with an explicit deployment target and application identity.
FlutterRuntimeErrorContextProvider adds bounded facts: target platform, web flag, lifecycle state, locale list, platform brightness, Flutter library and operation context, and the silent diagnostics flag. It does not collect widget trees, route arguments, input values, or arbitrary diagnostics.
Application-defined presentation
NavigatorErrorPresenter obtains the current root navigation context from an application-owned GlobalKey<NavigatorState> and calls FlutterErrorPresentationDelegate.
@override
Future<void> present(
BuildContext? context,
ErrorIncident incident,
ErrorPresentationDirective directive,
) async {
if (context == null || directive == ErrorPresentationDirective.none) return;
// Choose Material, Cupertino, navigation, or another app-specific UI.
}
The package does not impose dialogs, SnackBars, routes, wording, or visual style. The delegate must tolerate a null context during startup and shutdown.