# Data flow — flutter/flutter

> Canonical page: https://codevetter.com/unpack/flutter/data-flow

# Data flow — flutter/flutter

Scanned commit acb8fd51143a49384799557cb1df6ecead61a55a (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Tool data flow: argv -> executable.main -> FlutterCommandRunner (args package) -> FlutterCommand.verifyThenRun -> runCommand; all services resolve through an AppContext DI layer fed by globals.dart and the overrides map in executable.main. Runtime data flow: `flutter run` compiles Dart to kernel via ResidentCompiler, syncs sources+assets to the on-device DevFS over HTTP, and talks to the Dart VM service (vm_service package) for reload/attach; hot restart alternates a `.swap` dill name to dodge memory-mapped files. Framework data flow: runApp mounts the widget tree, drawFrame pumps build->layout->paint->composite into a Scene sent to the engine; MethodChannel calls serialize via codecs over BinaryMessenger into dart:ui's PlatformDispatcher.sendPlatformMessage, then through the engine's platform message handler to the embedder.
- Argument parsing is two-stage: findCommandName() in executable.dart does a throwaway parse to locate the command (handling -h/-? //? help idioms), then FlutterCommandRunner's real ArgParser (allowTrailingOptions: false) dispatches to the FlutterCommand. — [packages/flutter_tools/lib/executable.dart#L78-208](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/executable.dart#L78-L208) [packages/flutter_tools/lib/src/runner/flutter_command_runner.dart#L63-120](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart#L63-L120)
- FlutterDevice.create() wires the per-device compile pipeline: a DevelopmentShaderCompiler wrapping ShaderCompiler for Impeller shaders, and a ResidentCompiler (via residentCompilerFactory) for incremental Dart kernel generation targeting device.targetPlatform. — [packages/flutter_tools/lib/src/resident_runner.dart#L62-100](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/resident_runner.dart#L62-L100) [packages/flutter_tools/lib/src/compile.dart](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/compile.dart)
- DevFS (devfs.dart) is the transport for hot development: it uploads compiled kernel files and asset diffs to a per-app filesystem served by the VM service on the device. — [packages/flutter_tools/lib/src/devfs.dart](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/devfs.dart) [packages/flutter_tools/lib/src/resident_runner.dart#L30-48](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/resident_runner.dart#L30-L48)
- HotRunner._reloadSources() orchestrates reload: projectFileInvalidator computes changed files, ResidentCompiler.recompile emits a partial dill, devFS pushes it, _reloadSourcesService calls VM reloadSources, then _reassembleHelper triggers WidgetsBinding reassemble in the app. — [packages/flutter_tools/lib/src/run_hot.dart#L29-67](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/run_hot.dart#L29-L67) [packages/flutter_tools/lib/src/run_hot.dart#L957-1040](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/run_hot.dart#L957-L1040)
- Hot restart rewrites main.dart.dill into the device DevFS under alternating names (with/without .swap) because the previous dill may still be memory-mapped by the Windows embedder. — [packages/flutter_tools/lib/src/run_hot.dart#L109-120](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/run_hot.dart#L109-L120)
- The BuildSystem executes a Target DAG where each Target declares Source-pattern inputs/outputs; FileStore hashes file contents (md5/timestamp) and stamp files record inputs+outputs per run so unchanged targets are skipped; work is pooled at kMaxOpenFiles=64 concurrent file ops. — [packages/flutter_tools/lib/src/build_system/build_system.dart#L29-100](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/build_system/build_system.dart#L29-L100)
- App startup in the framework: runApp(app) -> WidgetsFlutterBinding.ensureInitialized() -> binding.wrapWithDefaultView(app) -> scheduleAttachRootWidget -> scheduleWarmUpFrame; frames then flow through handleBeginFrame/handleDrawFrame (documented 10-phase pipeline) -> drawFrame -> scene handed to the engine. — [packages/flutter/lib/src/widgets/binding.dart#L1887-1957](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter/lib/src/widgets/binding.dart#L1887-L1957) [packages/flutter/lib/src/widgets/binding.dart#L1483-1540](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter/lib/src/widgets/binding.dart#L1483-L1540)
- Platform channel flow: MethodChannel._invokeMethod encodes calls with a MethodCodec, sends through binaryMessenger -> dart:ui PlatformDispatcher.sendPlatformMessage -> engine.cc's platform message handling -> the embedder's registered channel handler; built-in channels are named in engine.cc (flutter/assets, flutter/lifecycle, flutter/navigation, flutter/localization, flutter/settings, flutter/isolate). — [packages/flutter/lib/src/services/platform_channel.dart#L291-418](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter/lib/src/services/platform_channel.dart#L291-L418) [engine/src/flutter/lib/ui/platform_dispatcher.dart](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/engine/src/flutter/lib/ui/platform_dispatcher.dart) [engine/src/flutter/shell/common/engine.cc#L23-28](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/engine/src/flutter/shell/common/engine.cc#L23-L28)
- Tool persistent state lives in bin/cache plus user config: Config (flutter config settings), PersistentToolState, and unified_analytics telemetry gated by --disable-analytics/--enable-analytics/--suppress-analytics handled in runner.run before dispatch. — [packages/flutter_tools/lib/runner.dart#L119-148](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/runner.dart#L119-L148) [packages/flutter_tools/lib/src/persistent_tool_state.dart](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/persistent_tool_state.dart)
- Crash path: unhandled errors in the zone go to _handleToolErrorImpl -> CrashReportSender.sendReport (skipped when running on a bot or with --local-engine) and a local flutter_*.log file is written to the cwd (falling back to system temp) containing command, exception, stack, and `flutter doctor` output. — [packages/flutter_tools/lib/runner.dart#L208-397](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/runner.dart#L208-L397) [packages/flutter_tools/lib/src/reporting/crash_reporting.dart](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/reporting/crash_reporting.dart)
- The daemon protocol multiplexes IDE traffic: DaemonConnection parses [json] envelopes and optional binary streams, dispatches to Domain handlers registered with registerDomain() (app, device, emulator, devtools), and emits events back over stdout. — [packages/flutter_tools/lib/src/daemon.dart#L14-45](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/daemon.dart#L14-L45) [packages/flutter_tools/lib/src/commands/daemon.dart#L307-422](https://github.com/flutter/flutter/blob/acb8fd51143a49384799557cb1df6ecead61a55a/packages/flutter_tools/lib/src/commands/daemon.dart#L307-L422)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
