[{"data":1,"prerenderedAt":820},["ShallowReactive",2],{"page-\u002Fdart":3},{"id":4,"title":5,"body":6,"description":813,"extension":814,"meta":815,"navigation":738,"path":816,"seo":817,"stem":818,"__hash__":819},"content\u002Fdart\u002Findex.md","Dart — Engineering Reference",{"type":7,"value":8,"toc":795},"minimark",[9,14,18,23,57,61,77,81,86,203,207,305,309,423,427,520,524,528,546,550,584,588,603,607,628,632,683,687,791],[10,11,13],"h1",{"id":12},"dart-engineering-reference","🎯 Dart — Engineering Reference",[15,16,17],"p",{},"A code-first, production-grade Dart engineering reference. Each chapter is a deep-dive with annotated code blocks covering complex implementations, anti-patterns, edge cases, and performance optimizations. Designed for mid-level developers transitioning to senior roles who learn best through rigorous, real-world code.",[19,20,22],"h2",{"id":21},"how-to-use-this-reference","How to Use This Reference",[24,25,26,34,40,51],"ol",{},[27,28,29,33],"li",{},[30,31,32],"strong",{},"Read sequentially"," for a complete engineering tour (01 → 19).",[27,35,36,39],{},[30,37,38],{},"Jump to a chapter"," as a reference when you hit a concept in production.",[27,41,42,45,46,50],{},[30,43,44],{},"Run the examples"," — ",[47,48,49],"code",{},"dart run"," is your REPL, DartPad for quick experiments.",[27,52,53,56],{},[30,54,55],{},"Focus on the anti-pattern sections"," — each shows the naive code, the trap, and the production fix.",[19,58,60],{"id":59},"prerequisites","Prerequisites",[62,63,64,71,74],"ul",{},[27,65,66,67,70],{},"The Dart SDK installed (",[47,68,69],{},"brew install dart"," or see chapter 01).",[27,72,73],{},"A code editor (VS Code with the Dart extension recommended).",[27,75,76],{},"Solid programming fundamentals (this is not a beginner tutorial).",[19,78,80],{"id":79},"curriculum","Curriculum",[82,83,85],"h3",{"id":84},"part-i-language-architecture","Part I — Language Architecture",[87,88,89,105],"table",{},[90,91,92],"thead",{},[93,94,95,99,102],"tr",{},[96,97,98],"th",{},"#",[96,100,101],{},"Topic",[96,103,104],{},"Why It Matters",[106,107,108,128,153,167,181],"tbody",{},[93,109,110,114,121],{},[111,112,113],"td",{},"01",[111,115,116],{},[117,118,120],"a",{"href":119},"\u002Fdart\u002F01-introduction-and-setup","Architecture, Compilation & Toolchain",[111,122,123,124,127],{},"AOT\u002FJIT\u002Fkernel pipeline, platform conditionals, ",[47,125,126],{},"pubspec.yaml",", native compilation.",[93,129,130,133,139],{},[111,131,132],{},"02",[111,134,135],{},[117,136,138],{"href":137},"\u002Fdart\u002F02-variables-and-data-types","Variables, Type System & Memory",[111,140,141,144,145,148,149,152],{},[47,142,143],{},"const"," canonicalization, ",[47,146,147],{},"late"," lazy init, platform-dependent ",[47,150,151],{},"int",", records.",[93,154,155,158,164],{},[111,156,157],{},"03",[111,159,160],{},[117,161,163],{"href":162},"\u002Fdart\u002F03-operators-and-expressions","Operators, Promotion & Expressions",[111,165,166],{},"Null-aware chains, type promotion rules, cascade mechanics, overflow.",[93,168,169,172,178],{},[111,170,171],{},"04",[111,173,174],{},[117,175,177],{"href":176},"\u002Fdart\u002F04-control-flow","Control Flow, Exhaustiveness & Patterns",[111,179,180],{},"Dart 3 exhaustive switches, sealed patterns, record destructuring, guards.",[93,182,183,186,192],{},[111,184,185],{},"05",[111,187,188],{},[117,189,191],{"href":190},"\u002Fdart\u002F05-functions-and-scope","Functions, Closures & Generators",[111,193,194,195,198,199,202],{},"Parameter semantics, closure capture, ",[47,196,197],{},"sync*","\u002F",[47,200,201],{},"async*",", callable classes.",[82,204,206],{"id":205},"part-ii-core-systems","Part II — Core Systems",[87,208,209,219],{},[90,210,211],{},[93,212,213,215,217],{},[96,214,98],{},[96,216,101],{},[96,218,104],{},[106,220,221,235,249,266,284],{},[93,222,223,226,232],{},[111,224,225],{},"06",[111,227,228],{},[117,229,231],{"href":230},"\u002Fdart\u002F06-collections","Collections, Iterables & Allocation",[111,233,234],{},"Lazy chain evaluation, spread\u002Fcollection-if, immutable views vs copies.",[93,236,237,240,246],{},[111,238,239],{},"07",[111,241,242],{},[117,243,245],{"href":244},"\u002Fdart\u002F07-classes-and-objects","Classes, Sealed Hierarchies & Mixins",[111,247,248],{},"Const canonicalization, sealed exhaustiveness, mixin linearization, factories.",[93,250,251,254,260],{},[111,252,253],{},"08",[111,255,256],{},[117,257,259],{"href":258},"\u002Fdart\u002F08-null-safety","Sound Null Safety & Flow Analysis",[111,261,262,263,265],{},"Promotion rules (fields\u002Fclosures\u002Fawait), ",[47,264,147],{}," semantics, nullable algebra.",[93,267,268,271,277],{},[111,269,270],{},"09",[111,272,273],{},[117,274,276],{"href":275},"\u002Fdart\u002F09-async-programming","Async Internals, Futures & Streams",[111,278,279,280,283],{},"Event loop, ",[47,281,282],{},"Future.wait"," composition, stream backpressure, zones.",[93,285,286,289,295],{},[111,287,288],{},"10",[111,290,291],{},[117,292,294],{"href":293},"\u002Fdart\u002F10-isolates-and-concurrency","Isolates, Actor Model & Zero-Copy",[111,296,297,300,301,304],{},[47,298,299],{},"Isolate.run",", worker pools, ",[47,302,303],{},"TransferableTypedData",", when to use isolates.",[82,306,308],{"id":307},"part-iii-advanced-semantics","Part III — Advanced Semantics",[87,310,311,321],{},[90,312,313],{},[93,314,315,317,319],{},[96,316,98],{},[96,318,101],{},[96,320,104],{},[106,322,323,352,373,391,409],{},[93,324,325,328,334],{},[111,326,327],{},"11",[111,329,330],{},[117,331,333],{"href":332},"\u002Fdart\u002F11-error-handling","Exceptions, Errors & Async Propagation",[111,335,336,339,340,343,344,347,348,351],{},[47,337,338],{},"Exception"," vs ",[47,341,342],{},"Error",", ",[47,345,346],{},"rethrow"," stack preservation, ",[47,349,350],{},"runZonedGuarded",", swallow traps.",[93,353,354,357,363],{},[111,355,356],{},"12",[111,358,359],{},[117,360,362],{"href":361},"\u002Fdart\u002F12-generics","Reified Generics, Bounds & Covariance",[111,364,365,366,339,369,372],{},"Runtime type info, bounded params, covariance soundness, ",[47,367,368],{},"is T",[47,370,371],{},"as T",".",[93,374,375,378,384],{},[111,376,377],{},"13",[111,379,380],{},[117,381,383],{"href":382},"\u002Fdart\u002F13-packages-and-libraries","Libraries, Visibility & Packages",[111,385,386,387,390],{},"Library-private ",[47,388,389],{},"_",", conditional imports, barrel files, deferred loading.",[93,392,393,396,402],{},[111,394,395],{},"14",[111,397,398],{},[117,399,401],{"href":400},"\u002Fdart\u002F14-testing","Testing, Mocking & Async Patterns",[111,403,404,405,408],{},"Matcher composition, async test semantics, ",[47,406,407],{},"mocktail",", parameterized tests.",[93,410,411,414,420],{},[111,412,413],{},"15",[111,415,416],{},[117,417,419],{"href":418},"\u002Fdart\u002F15-dart-for-the-web","Web Compilation, JS Interop & Cross-Platform",[111,421,422],{},"dart2js\u002FDDC\u002FWasm, extension types, conditional imports, web limitations.",[82,424,426],{"id":425},"part-iv-application-production","Part IV — Application & Production",[87,428,429,439],{},[90,430,431],{},[93,432,433,435,437],{},[96,434,98],{},[96,436,101],{},[96,438,104],{},[106,440,441,461,482,506],{},[93,442,443,446,452],{},[111,444,445],{},"16",[111,447,448],{},[117,449,451],{"href":450},"\u002Fdart\u002F16-flutter-essentials","Flutter Widget Architecture & Lifecycle",[111,453,454,456,457,460],{},[47,455,143],{}," canonicalization, build purity, ",[47,458,459],{},"mounted"," after await, state management.",[93,462,463,466,472],{},[111,464,465],{},"17",[111,467,468],{},[117,469,471],{"href":470},"\u002Fdart\u002F17-server-side-dart","Server Architecture, Middleware & Database",[111,473,474,477,478,481],{},[47,475,476],{},"shelf"," pipelines, ",[47,479,480],{},"dart_frog"," routing, streaming I\u002FO, parameterized SQL, AOT deploy.",[93,483,484,487,493],{},[111,485,486],{},"18",[111,488,489],{},[117,490,492],{"href":491},"\u002Fdart\u002F18-tooling-and-ecosystem","Tooling, Code Generation & CI\u002FCD",[111,494,495,496,343,499,198,502,505],{},"Strict analysis, ",[47,497,498],{},"build_runner",[47,500,501],{},"freezed",[47,503,504],{},"json_serializable",", CI pipeline.",[93,507,508,511,517],{},[111,509,510],{},"19",[111,512,513],{},[117,514,516],{"href":515},"\u002Fdart\u002F19-exercises-and-projects","Production Projects & Capstone",[111,518,519],{},"CLI parser, stream pipeline, isolate image processor, full-stack capstone.",[19,521,523],{"id":522},"learning-path-suggestions","Learning Path Suggestions",[82,525,527],{"id":526},"if-youre-coming-from-javascripttypescript","If you're coming from JavaScript\u002FTypeScript",[15,529,530,531,198,533,198,536,538,539,198,542,545],{},"Read 02–03 (type system is stricter, ",[47,532,143],{},[47,534,535],{},"final",[47,537,147],{}," differ). Read 08 (sound null safety — promotion rules differ from TS). Read 09 (async — ",[47,540,541],{},"Future",[47,543,544],{},"Stream"," like Promise\u002FAsyncIterator but with backpressure). Read 07 (sealed classes, mixins). Read 16 (Flutter) if doing UI.",[82,547,549],{"id":548},"if-youre-coming-from-javackotlin","If you're coming from Java\u002FC#\u002FKotlin",[15,551,552,553,198,556,198,558,560,561,564,565,198,568,571,572,198,574,576,577,198,580,583],{},"Read 02–03 (syntax is familiar, but ",[47,554,555],{},"var",[47,557,535],{},[47,559,143],{},"\u002Fnull-safety differ). Read 05 (named params, ",[47,562,563],{},"required","). Read 07 (sealed classes, mixins — Dart 3). Read 08 (null safety — ",[47,566,567],{},"?",[47,569,570],{},"!","\u002Fpromotion). Read 12 (reified generics — unlike Java's erasure). Read 09 (async — ",[47,573,541],{},[47,575,544],{}," like ",[47,578,579],{},"CompletableFuture",[47,581,582],{},"Flow",").",[82,585,587],{"id":586},"if-youre-learning-dart-for-flutter","If you're learning Dart for Flutter",[15,589,590,591,594,595,597,598,343,600,602],{},"Read 01–09 (core language). Skim 10 (isolates — rare in Flutter). Read 16 (Flutter widget lifecycle, ",[47,592,593],{},"build"," purity, ",[47,596,459],{},") closely. Read 18 (",[47,599,498],{},[47,601,501],{},"). Read 15 (web) if targeting Flutter Web.",[82,604,606],{"id":605},"if-youre-a-senior-dartflutter-engineer","If you're a senior Dart\u002FFlutter engineer",[15,608,609,610,612,613,615,616,339,618,620,621,623,624,627],{},"Focus on 03 (promotion across closures\u002Fawait\u002Ffields), 07 (sealed exhaustiveness, mixin linearization), 08 (promotion pitfalls), 09 (",[47,611,282],{}," composition, stream backpressure, zones), 10 (",[47,614,303],{},", worker pools), 12 (covariance soundness, ",[47,617,368],{},[47,619,371],{},"), 17 (",[47,622,476],{}," middleware, streaming I\u002FO, ",[47,625,626],{},"dart compile exe","), 19 (production patterns, capstone).",[19,629,631],{"id":630},"companion-resources","Companion Resources",[62,633,634,643,651,659,667,675],{},[27,635,636,642],{},[117,637,641],{"href":638,"rel":639},"https:\u002F\u002Fdart.dev",[640],"nofollow","Dart.dev"," — official docs (language tour, library tour).",[27,644,645,650],{},[117,646,649],{"href":647,"rel":648},"https:\u002F\u002Fdartpad.dev",[640],"DartPad"," — online editor, no install.",[27,652,653,658],{},[117,654,657],{"href":655,"rel":656},"https:\u002F\u002Fpub.dev",[640],"pub.dev"," — package registry.",[27,660,661,666],{},[117,662,665],{"href":663,"rel":664},"https:\u002F\u002Fdart.dev\u002Fguides\u002Flanguage\u002Feffective-dart",[640],"Effective Dart"," — style and best practices.",[27,668,669,674],{},[117,670,673],{"href":671,"rel":672},"https:\u002F\u002Fdocs.flutter.dev",[640],"Flutter Docs"," — for Flutter (chapter 16).",[27,676,677,682],{},[117,678,681],{"href":679,"rel":680},"https:\u002F\u002Fapi.dart.dev",[640],"Dart API Reference"," — core libraries.",[19,684,686],{"id":685},"tooling","Tooling",[688,689,691],"code-wrapper",{"language":690},"bash",[692,693,697],"pre",{"className":694,"code":695,"language":690,"meta":696,"style":696},"language-bash shiki shiki-themes github-light github-dark","# Install the Dart SDK (macOS):\nbrew tap dart-lang\u002Fdart\nbrew install dart\n\n# Verify:\ndart --version\n\n# VS Code with the Dart extension (Dart-Code.dart-code):\n# - Code completion, refactoring, debugging\n# - Hot reload (Flutter)\n# - dart format on save\n# - dart analyze diagnostics\n","",[47,698,699,708,722,733,740,746,756,761,767,773,779,785],{"__ignoreMap":696},[700,701,704],"span",{"class":702,"line":703},"line",1,[700,705,707],{"class":706},"sdCPZ","# Install the Dart SDK (macOS):\n",[700,709,711,715,719],{"class":702,"line":710},2,[700,712,714],{"class":713},"sIsaT","brew",[700,716,718],{"class":717},"sJ6F3"," tap",[700,720,721],{"class":717}," dart-lang\u002Fdart\n",[700,723,725,727,730],{"class":702,"line":724},3,[700,726,714],{"class":713},[700,728,729],{"class":717}," install",[700,731,732],{"class":717}," dart\n",[700,734,736],{"class":702,"line":735},4,[700,737,739],{"emptyLinePlaceholder":738},true,"\n",[700,741,743],{"class":702,"line":742},5,[700,744,745],{"class":706},"# Verify:\n",[700,747,749,752],{"class":702,"line":748},6,[700,750,751],{"class":713},"dart",[700,753,755],{"class":754},"snvgF"," --version\n",[700,757,759],{"class":702,"line":758},7,[700,760,739],{"emptyLinePlaceholder":738},[700,762,764],{"class":702,"line":763},8,[700,765,766],{"class":706},"# VS Code with the Dart extension (Dart-Code.dart-code):\n",[700,768,770],{"class":702,"line":769},9,[700,771,772],{"class":706},"# - Code completion, refactoring, debugging\n",[700,774,776],{"class":702,"line":775},10,[700,777,778],{"class":706},"# - Hot reload (Flutter)\n",[700,780,782],{"class":702,"line":781},11,[700,783,784],{"class":706},"# - dart format on save\n",[700,786,788],{"class":702,"line":787},12,[700,789,790],{"class":706},"# - dart analyze diagnostics\n",[792,793,794],"style",{},"html pre.shiki code .sdCPZ, html code.shiki .sdCPZ{--shiki-default:#6A737D;--shiki-github-dark:#6A737D}html pre.shiki code .sIsaT, html code.shiki .sIsaT{--shiki-default:#6F42C1;--shiki-github-dark:#B392F0}html pre.shiki code .sJ6F3, html code.shiki .sJ6F3{--shiki-default:#032F62;--shiki-github-dark:#9ECBFF}html pre.shiki code .snvgF, html code.shiki .snvgF{--shiki-default:#005CC5;--shiki-github-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .github-dark .shiki span {color: var(--shiki-github-dark);background: var(--shiki-github-dark-bg);font-style: var(--shiki-github-dark-font-style);font-weight: var(--shiki-github-dark-font-weight);text-decoration: var(--shiki-github-dark-text-decoration);}html.github-dark .shiki span {color: var(--shiki-github-dark);background: var(--shiki-github-dark-bg);font-style: var(--shiki-github-dark-font-style);font-weight: var(--shiki-github-dark-font-weight);text-decoration: var(--shiki-github-dark-text-decoration);}",{"title":696,"searchDepth":710,"depth":710,"links":796},[797,798,799,805,811,812],{"id":21,"depth":710,"text":22},{"id":59,"depth":710,"text":60},{"id":79,"depth":710,"text":80,"children":800},[801,802,803,804],{"id":84,"depth":724,"text":85},{"id":205,"depth":724,"text":206},{"id":307,"depth":724,"text":308},{"id":425,"depth":724,"text":426},{"id":522,"depth":710,"text":523,"children":806},[807,808,809,810],{"id":526,"depth":724,"text":527},{"id":548,"depth":724,"text":549},{"id":586,"depth":724,"text":587},{"id":605,"depth":724,"text":606},{"id":630,"depth":710,"text":631},{"id":685,"depth":710,"text":686},"A deep-dive, code-first Dart engineering reference. 19 chapters covering the compilation pipeline, type system, pattern matching, async internals, isolate concurrency, sealed hierarchies, reified generics, server architecture, Flutter lifecycle, and production tooling. For mid-level developers moving to senior roles.","md",{},"\u002Fdart",{"title":5,"description":813},"dart\u002Findex","YUKjyzmXfSYa0tywL7obb-BVwjN_zyI-YupFREt0oew",1789924648031]