@cassiomc1/forgeloop 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2106 @@
1
+ ---
2
+ name: flutter-development-eng
3
+ language: en
4
+ description: "Specialist guide for architecture, implementation, testing, performance, accessibility, platform integration, and release of production Flutter applications."
5
+ version: "2026.09"
6
+ last-reviewed: "2026-09-09"
7
+ guide-id: flutter
8
+ ---
9
+ # Flutter Development Engineering Guide
10
+
11
+ > Production-oriented Flutter specialist guidance for ForgeLoop-enabled AI coding agents and developers.
12
+ >
13
+ > This guide is an operational synthesis of the official Flutter documentation at `https://docs.flutter.dev/`, reviewed against the documentation baseline current on 2026-09-09. The Flutter documentation reviewed for this guide generally reports Flutter 3.47.2. Version-sensitive behavior MUST be verified against the project's pinned SDK and the current official documentation before changing code.
14
+ >
15
+ > This guide complements, rather than replaces, ForgeLoop's general engineering guides. For code structure and maintainability use `clean-code-eng.md`; for verification strategy use `test-code-eng.md`; for threat modeling and trust boundaries use `sec-code-eng.md`; for measured optimization use `perf-code-eng.md`; for visual design use `design-code-eng.md`; and for inclusive interfaces use `accessibility-eng.md`.
16
+ >
17
+ > Tooling policy: inspect the repository and use already-available tools first. Do not install Flutter, Dart, packages, plugins, SDK components, emulators, native toolchains, AI plugins, or global utilities merely to satisfy a check. Installation or environment mutation requires authority under ForgeLoop policy. If a required check cannot run, report it as blocked or `NOT_VERIFIED`; never claim it passed.
18
+
19
+ ## 1. Mission
20
+
21
+ The Flutter specialist exists to make Flutter changes that are:
22
+
23
+ - idiomatic for the actual Flutter and Dart versions used by the repository;
24
+ - coherent with the project's existing architecture;
25
+ - correct across the target platforms that the project actually supports;
26
+ - testable at the appropriate level;
27
+ - accessible and adaptive where users interact with the result;
28
+ - measurable when performance is relevant;
29
+ - explicit about native, web, storage, networking, and security boundaries;
30
+ - releasable with evidence rather than assumption;
31
+ - minimal in scope while complete for the requested behavior.
32
+
33
+ The specialist MUST optimize for repository truth rather than generic Flutter preference.
34
+
35
+ ## 2. Authority and precedence
36
+
37
+ Use the following precedence when instructions conflict:
38
+
39
+ 1. Platform and safety rules.
40
+ 2. The user's latest explicit request.
41
+ 3. Repository-local instructions such as `AGENTS.md`, `CLAUDE.md`, `PROJECT_PROFILE.md`, and nested instructions.
42
+ 4. The actual dependency graph, manifests, generated configuration, target platforms, tests, and source code.
43
+ 5. The project's established architectural and style conventions.
44
+ 6. This Flutter guide.
45
+ 7. General examples from official documentation.
46
+ 8. Community conventions and third-party package examples.
47
+
48
+ Do not rewrite a functioning architecture merely because another architecture is fashionable or appears in a tutorial.
49
+
50
+ ## 3. Mandatory discovery before implementation
51
+
52
+ Before changing Flutter code, establish the real project state.
53
+
54
+ Inspect, when present:
55
+
56
+ - `pubspec.yaml`
57
+ - `pubspec.lock`
58
+ - `analysis_options.yaml`
59
+ - `lib/`
60
+ - `test/`
61
+ - `integration_test/`
62
+ - `android/`
63
+ - `ios/`
64
+ - `web/`
65
+ - `macos/`
66
+ - `windows/`
67
+ - `linux/`
68
+ - `assets/`
69
+ - `l10n.yaml`
70
+ - `.metadata`
71
+ - flavors, build scripts, Fastlane, CI configuration, Firebase configuration, and release scripts
72
+ - router configuration
73
+ - dependency-injection setup
74
+ - state-management setup
75
+ - generated-code configuration
76
+ - platform-channel or FFI code
77
+ - existing test helpers and golden infrastructure
78
+
79
+ Useful commands, only when already available and authorized:
80
+
81
+ ```bash
82
+ flutter --version
83
+ dart --version
84
+ flutter doctor -v
85
+ flutter devices
86
+ flutter pub deps
87
+ git status --short
88
+ ```
89
+
90
+ Record at least:
91
+
92
+ - Flutter SDK version and channel if discoverable;
93
+ - Dart version;
94
+ - package/app type;
95
+ - target platforms;
96
+ - current routing strategy;
97
+ - current state-management strategy;
98
+ - architecture pattern;
99
+ - code-generation tools;
100
+ - native integrations;
101
+ - CI and release surfaces;
102
+ - the smallest checks that can prove the requested change.
103
+
104
+ Do not infer a target platform merely because its generated folder exists. Confirm from project configuration, CI, release scripts, documentation, and user intent.
105
+
106
+ ## 4. Version-sensitive decision rule
107
+
108
+ Flutter evolves quickly. Treat these areas as version-sensitive:
109
+
110
+ - navigation and deep linking;
111
+ - web rendering and WebAssembly;
112
+ - Material and Cupertino component behavior;
113
+ - platform embedding;
114
+ - native interop and FFI templates;
115
+ - plugin APIs;
116
+ - accessibility semantics;
117
+ - generated localization;
118
+ - build and deployment flags;
119
+ - DevTools workflows;
120
+ - AI/MCP/agent tooling.
121
+
122
+ For a version-sensitive change:
123
+
124
+ 1. identify the project's actual Flutter version;
125
+ 2. inspect current project usage;
126
+ 3. verify the relevant official documentation for that version or migration path;
127
+ 4. avoid speculative migrations;
128
+ 5. document any compatibility assumption.
129
+
130
+ Never copy a current-doc example blindly into a substantially older project.
131
+
132
+ ## 5. Flutter mental model
133
+
134
+ ### 5.1 Declarative reactive UI
135
+
136
+ Flutter UI is a function of state. Prefer expressing the desired interface for the current state rather than manually mutating view elements.
137
+
138
+ A useful model is:
139
+
140
+ ```text
141
+ state -> widget configuration -> element/render updates -> pixels
142
+ ```
143
+
144
+ State changes trigger rebuild work. Rebuilds are expected; expensive work inside rebuilds is not.
145
+
146
+ ### 5.2 Composition over inheritance
147
+
148
+ Prefer composing small widgets and behaviors instead of creating deep inheritance hierarchies.
149
+
150
+ Use inheritance when the framework contract requires it, such as:
151
+
152
+ - `StatelessWidget`
153
+ - `StatefulWidget`
154
+ - `ChangeNotifier`
155
+ - custom render objects
156
+ - delegates
157
+ - plugin/platform interfaces
158
+
159
+ Do not invent inheritance solely to share UI fragments that compose naturally.
160
+
161
+ ### 5.3 Layout rule
162
+
163
+ The essential Flutter layout rule is:
164
+
165
+ ```text
166
+ Constraints go down.
167
+ Sizes go up.
168
+ Parents set positions.
169
+ ```
170
+
171
+ When debugging overflow, unexpected width/height, flex, scrolling, or nested layouts, reason from constraints before adding wrappers.
172
+
173
+ Do not use `Center`, `Expanded`, `SizedBox`, `IntrinsicWidth`, or `SingleChildScrollView` as random overflow fixes without understanding the constraint chain.
174
+
175
+ ## 6. Architecture
176
+
177
+ ### 6.1 Default architecture for scalable applications
178
+
179
+ For a feature-rich application, prefer the responsibilities recommended by Flutter's architecture guidance:
180
+
181
+ ```text
182
+ UI layer
183
+ View
184
+ ViewModel
185
+
186
+ Data layer
187
+ Repository
188
+ Service
189
+
190
+ Optional domain layer
191
+ Use cases / domain coordination where complexity justifies it
192
+ ```
193
+
194
+ Typical dependency direction:
195
+
196
+ ```text
197
+ View
198
+ -> ViewModel
199
+ -> Repository
200
+ -> Service
201
+ -> network / storage / platform / SDK
202
+ ```
203
+
204
+ Keep dependencies pointing toward abstractions or lower-level responsibilities intentionally. Avoid circular feature dependencies.
205
+
206
+ ### 6.2 Views
207
+
208
+ A view SHOULD contain:
209
+
210
+ - widget composition;
211
+ - layout;
212
+ - animation orchestration;
213
+ - presentation-only conditionals;
214
+ - simple route initiation;
215
+ - event wiring to view-model commands/actions.
216
+
217
+ A view SHOULD NOT own:
218
+
219
+ - network orchestration;
220
+ - persistence logic;
221
+ - retry policy;
222
+ - domain rules;
223
+ - data normalization;
224
+ - authentication logic;
225
+ - business validation beyond immediate presentation constraints.
226
+
227
+ Keep a view easy to render in a widget test.
228
+
229
+ ### 6.3 ViewModels
230
+
231
+ A ViewModel SHOULD:
232
+
233
+ - expose the state required by one view or one tightly bounded UI surface;
234
+ - call repositories;
235
+ - transform model data for presentation;
236
+ - expose user actions/commands;
237
+ - own loading/error/success state relevant to its view;
238
+ - avoid direct widget dependencies whenever practical.
239
+
240
+ A ViewModel SHOULD NOT:
241
+
242
+ - know concrete widget instances;
243
+ - parse raw HTTP payloads;
244
+ - perform platform-channel calls directly when a service boundary is appropriate;
245
+ - become a global dumping ground for unrelated feature state.
246
+
247
+ ### 6.4 Repositories
248
+
249
+ A repository is the app-facing source of truth for a model or cohesive data domain.
250
+
251
+ Repositories may own:
252
+
253
+ - cache policy;
254
+ - synchronization strategy;
255
+ - model composition;
256
+ - retry decisions;
257
+ - error normalization;
258
+ - merging local and remote sources;
259
+ - streams of shared app data.
260
+
261
+ Repositories SHOULD return application-meaningful models rather than transport DTOs when that separation improves clarity.
262
+
263
+ ### 6.5 Services
264
+
265
+ Services wrap external data sources or platform APIs.
266
+
267
+ Examples:
268
+
269
+ - REST/GraphQL client;
270
+ - local database adapter;
271
+ - secure-storage adapter;
272
+ - file service;
273
+ - geolocation plugin wrapper;
274
+ - platform-channel adapter.
275
+
276
+ Services SHOULD have explicit inputs and outputs and SHOULD NOT silently own cross-feature application state.
277
+
278
+ ### 6.6 Optional domain/use-case layer
279
+
280
+ Add a domain/use-case layer when:
281
+
282
+ - a business operation coordinates several repositories;
283
+ - the same rule is used by multiple ViewModels;
284
+ - transaction semantics are non-trivial;
285
+ - policy deserves a stable isolated test boundary.
286
+
287
+ Do not create one-line use-case wrappers around every repository method.
288
+
289
+ ### 6.7 Dependency injection
290
+
291
+ Prefer constructor injection because dependencies remain visible and tests remain straightforward.
292
+
293
+ Example:
294
+
295
+ ```dart
296
+ class AccountRepository {
297
+ AccountRepository({required AccountApi api}) : _api = api;
298
+
299
+ final AccountApi _api;
300
+ }
301
+
302
+ class AccountViewModel extends ChangeNotifier {
303
+ AccountViewModel({required AccountRepository repository})
304
+ : _repository = repository;
305
+
306
+ final AccountRepository _repository;
307
+ }
308
+ ```
309
+
310
+ A service locator or DI container can manage lifecycle at composition boundaries, but domain classes should not need to query a global container during ordinary work.
311
+
312
+ ### 6.8 Existing architecture preservation
313
+
314
+ If the project already uses a coherent architecture such as BLoC, Riverpod-based feature modules, Redux, Clean Architecture, or another established pattern:
315
+
316
+ - preserve it unless the task requires an architectural change;
317
+ - map this guide's responsibilities onto the existing boundaries;
318
+ - avoid mixing competing state-management patterns inside one feature without a migration plan;
319
+ - test boundaries rather than renaming concepts to match this document.
320
+
321
+ ## 7. Project organization
322
+
323
+ Prefer discoverability over a universal folder ideology.
324
+
325
+ For medium or large apps, feature-oriented structure is often easier to navigate:
326
+
327
+ ```text
328
+ lib/
329
+ app/
330
+ app.dart
331
+ router.dart
332
+ theme/
333
+ core/
334
+ errors/
335
+ networking/
336
+ platform/
337
+ features/
338
+ account/
339
+ data/
340
+ presentation/
341
+ domain/ # optional
342
+ settings/
343
+ data/
344
+ presentation/
345
+ ```
346
+
347
+ An architecture-oriented structure can also be valid:
348
+
349
+ ```text
350
+ lib/
351
+ ui/
352
+ view_models/
353
+ repositories/
354
+ services/
355
+ models/
356
+ ```
357
+
358
+ Choose the structure already established by the repository unless there is a concrete navigation or dependency problem.
359
+
360
+ Generated code SHOULD be predictable and SHOULD NOT contain hand-edited business logic.
361
+
362
+ ## 8. State management
363
+
364
+ ### 8.1 Classify state before selecting a mechanism
365
+
366
+ Distinguish:
367
+
368
+ - ephemeral UI state: local selection, animation state, temporary expanded/collapsed state, focus;
369
+ - feature state: screen data, asynchronous status, form workflow;
370
+ - app state: authentication session, shared preferences, cart, global connectivity policy;
371
+ - persisted state: information that must survive process termination.
372
+
373
+ Do not make all state global.
374
+
375
+ ### 8.2 Local state first
376
+
377
+ Use local widget state when state is:
378
+
379
+ - owned by one widget subtree;
380
+ - cheap to recreate;
381
+ - not needed outside that subtree;
382
+ - naturally tied to a widget lifecycle.
383
+
384
+ Use broader state management only when ownership or sharing requires it.
385
+
386
+ ### 8.3 Existing package first
387
+
388
+ If the project already uses `provider`, Riverpod, BLoC/Cubit, Redux, Signals, or another established solution:
389
+
390
+ - follow the existing pattern;
391
+ - reuse established providers/blocs/notifiers/stores;
392
+ - preserve lifecycle and disposal conventions;
393
+ - add a second framework only with explicit architectural justification.
394
+
395
+ ### 8.4 `ChangeNotifier`
396
+
397
+ `ChangeNotifier` remains suitable for straightforward ViewModels and observable state.
398
+
399
+ Use it carefully:
400
+
401
+ - mutate state in controlled methods;
402
+ - call `notifyListeners()` only after meaningful observable changes;
403
+ - prevent duplicate in-flight actions when needed;
404
+ - dispose owned resources;
405
+ - avoid enormous global notifiers.
406
+
407
+ ### 8.5 Command-style actions
408
+
409
+ For repeated async action states, a command abstraction can separate:
410
+
411
+ - idle;
412
+ - running;
413
+ - success/result;
414
+ - error.
415
+
416
+ Example intent:
417
+
418
+ ```dart
419
+ sealed class SaveState {
420
+ const SaveState();
421
+ }
422
+
423
+ final class SaveIdle extends SaveState {}
424
+ final class SaveRunning extends SaveState {}
425
+ final class SaveSuccess extends SaveState {}
426
+ final class SaveFailure extends SaveState {
427
+ const SaveFailure(this.error);
428
+ final Object error;
429
+ }
430
+ ```
431
+
432
+ The exact representation should match project conventions.
433
+
434
+ ### 8.6 Result-style error flow
435
+
436
+ Across architectural boundaries, explicit result objects can make failure paths visible.
437
+
438
+ Example:
439
+
440
+ ```dart
441
+ sealed class Result<T> {
442
+ const Result();
443
+ }
444
+
445
+ final class Ok<T> extends Result<T> {
446
+ const Ok(this.value);
447
+ final T value;
448
+ }
449
+
450
+ final class Err<T> extends Result<T> {
451
+ const Err(this.error);
452
+ final AppError error;
453
+ }
454
+ ```
455
+
456
+ Do not wrap every local programming error in a result type. Use results when callers are expected to handle domain or integration outcomes.
457
+
458
+ ## 9. Widgets and UI composition
459
+
460
+ ### 9.1 Prefer small cohesive widgets
461
+
462
+ Extract widgets when they:
463
+
464
+ - have an independent responsibility;
465
+ - have meaningful inputs;
466
+ - can be tested independently;
467
+ - reduce rebuild scope;
468
+ - clarify layout;
469
+ - are reused.
470
+
471
+ Do not extract every `Padding` or `Text` into a class without a semantic reason.
472
+
473
+ ### 9.2 Use `const` where valid
474
+
475
+ Prefer `const` constructors and instances when inputs are compile-time constants.
476
+
477
+ Benefits include:
478
+
479
+ - clearer immutability;
480
+ - potential widget reuse;
481
+ - less unnecessary object construction.
482
+
483
+ Do not distort APIs just to maximize `const`.
484
+
485
+ ### 9.3 Keys
486
+
487
+ Use keys intentionally.
488
+
489
+ Typical cases:
490
+
491
+ - preserve identity across reorder;
492
+ - distinguish same-type siblings;
493
+ - target widgets in tests;
494
+ - preserve state while moving widgets.
495
+
496
+ Avoid random `UniqueKey()` usage because it intentionally destroys identity and may recreate state.
497
+
498
+ ### 9.4 Build methods
499
+
500
+ A `build()` method should be:
501
+
502
+ - deterministic for the same state and inherited context;
503
+ - free of network calls;
504
+ - free of persistence writes;
505
+ - free of one-time side effects;
506
+ - cheap enough to run frequently.
507
+
508
+ Do not trigger API calls, analytics mutation, dialogs, navigation, or persistence merely because a widget rebuilt.
509
+
510
+ ### 9.5 Side effects
511
+
512
+ Run side effects from explicit lifecycle or action boundaries.
513
+
514
+ Examples:
515
+
516
+ - `initState()` for lifecycle-owned initialization when appropriate;
517
+ - a ViewModel initialization command;
518
+ - user action handlers;
519
+ - post-frame callbacks only when a frame-dependent side effect is truly required.
520
+
521
+ Treat `addPostFrameCallback` as a specialized mechanism, not a universal fix.
522
+
523
+ ## 10. Layout, scrolling, and constraints
524
+
525
+ ### 10.1 Flex
526
+
527
+ Use `Row`, `Column`, `Expanded`, and `Flexible` according to actual constraints.
528
+
529
+ Common failure:
530
+
531
+ ```text
532
+ Column
533
+ -> Expanded
534
+ inside an unbounded vertical scrollable
535
+ ```
536
+
537
+ Understand whether the main axis is bounded before applying flex.
538
+
539
+ ### 10.2 Scrolling
540
+
541
+ Choose based on content behavior:
542
+
543
+ - `ListView` for lists;
544
+ - `GridView` for grids;
545
+ - slivers for coordinated custom scrolling;
546
+ - `SingleChildScrollView` for small bounded content that must scroll as one unit.
547
+
548
+ Do not render thousands of children eagerly in `Column` + `SingleChildScrollView` when lazy lists are appropriate.
549
+
550
+ ### 10.3 Intrinsic layout
551
+
552
+ Intrinsic measurement can require additional layout passes.
553
+
554
+ Use `IntrinsicHeight`/`IntrinsicWidth` only when the UX requires it and the measured cost is acceptable.
555
+
556
+ ### 10.4 Safe areas
557
+
558
+ Respect system UI, display cutouts, and platform insets.
559
+
560
+ Use:
561
+
562
+ - `SafeArea` when the whole surface should avoid system intrusions;
563
+ - `MediaQuery` selectively for current environment data;
564
+ - padding/insets appropriate to keyboard and system UI behavior.
565
+
566
+ ### 10.5 Large screens and foldables
567
+
568
+ Do not scale a phone layout indefinitely.
569
+
570
+ Consider:
571
+
572
+ - navigation rail or side navigation;
573
+ - multi-pane layouts;
574
+ - maximum content widths;
575
+ - readable line length;
576
+ - pointer/keyboard interaction;
577
+ - window resize;
578
+ - hinge/fold geometry when relevant.
579
+
580
+ ## 11. Adaptive and responsive design
581
+
582
+ Responsive means fitting the interface to available space. Adaptive means selecting interaction and layout behavior suitable for the space and platform.
583
+
584
+ The specialist SHOULD:
585
+
586
+ 1. abstract shared content/data;
587
+ 2. measure the available space where the decision is made;
588
+ 3. switch layout or interaction pattern at meaningful breakpoints;
589
+ 4. preserve state across layout changes;
590
+ 5. test narrow, medium, large, text-scaled, and orientation-changed states.
591
+
592
+ Avoid user-agent or device-name branching when capability or available size is the real requirement.
593
+
594
+ ### 11.1 Platform idioms
595
+
596
+ Respect platform expectations where they improve usability:
597
+
598
+ - keyboard shortcuts;
599
+ - selectable text;
600
+ - pointer hover;
601
+ - context menus;
602
+ - scrollbars;
603
+ - menu bars;
604
+ - title bars;
605
+ - drag and drop;
606
+ - back behavior;
607
+ - text selection;
608
+ - control density.
609
+
610
+ A shared codebase does not require identical behavior everywhere.
611
+
612
+ ## 12. Material, Cupertino, and theming
613
+
614
+ Flutter ships Material and Cupertino design-system widgets.
615
+
616
+ Use:
617
+
618
+ - Material widgets for Material applications;
619
+ - Cupertino widgets where iOS/macOS fidelity is a product requirement;
620
+ - adaptive widgets or platform-specific composition when behavior genuinely differs.
621
+
622
+ Centralize design tokens in theme configuration where possible:
623
+
624
+ - colors;
625
+ - typography;
626
+ - component themes;
627
+ - shape;
628
+ - spacing conventions;
629
+ - dark/light variants.
630
+
631
+ Avoid hard-coded one-off colors and text styles scattered through features.
632
+
633
+ Do not assume platform adaptation means replacing the entire visual identity. Adapt interaction idioms and system expectations intentionally.
634
+
635
+ ## 13. Navigation and routing
636
+
637
+ ### 13.1 Simple navigation
638
+
639
+ For small apps without complex deep linking, `Navigator` with explicit routes can be enough.
640
+
641
+ ### 13.2 Complex navigation and deep links
642
+
643
+ For apps with:
644
+
645
+ - web URL synchronization;
646
+ - deep links;
647
+ - nested navigation;
648
+ - guarded routes;
649
+ - multiple navigators;
650
+ - complex restoration;
651
+
652
+ prefer a declarative Router-based solution such as `go_router` when consistent with the project.
653
+
654
+ Current Flutter documentation does not recommend named routes for most applications.
655
+
656
+ Do not migrate an existing stable router merely because `go_router` is common. Migrate only for a demonstrated requirement.
657
+
658
+ ### 13.3 Route ownership
659
+
660
+ Keep:
661
+
662
+ - route configuration centralized or predictably feature-composed;
663
+ - route parameters typed/validated;
664
+ - authentication/authorization redirects explicit;
665
+ - deep-link behavior tested;
666
+ - web back/forward behavior verified for web targets.
667
+
668
+ Do not place business authorization exclusively in client-side route guards. Server-side authorization remains mandatory for protected data/actions.
669
+
670
+ ### 13.4 Pageless routes
671
+
672
+ Dialogs, sheets, and imperative pushed routes can be pageless relative to declarative page stacks. Verify their behavior when parent page-backed routes change.
673
+
674
+ ### 13.5 Deep links
675
+
676
+ For deep links, verify both:
677
+
678
+ - Flutter route parsing/behavior;
679
+ - platform association configuration.
680
+
681
+ Platform configuration may include:
682
+
683
+ - Android app links and `assetlinks.json`;
684
+ - iOS universal links and associated domains;
685
+ - web server rewrite/fallback behavior.
686
+
687
+ A local `adb` launch can prove app route handling but does not prove hosted association files are valid.
688
+
689
+ ## 14. Forms and input
690
+
691
+ Separate:
692
+
693
+ - input presentation;
694
+ - field-level validation;
695
+ - domain validation;
696
+ - server validation.
697
+
698
+ Client validation improves UX but is not a security boundary.
699
+
700
+ For forms:
701
+
702
+ - preserve input state intentionally;
703
+ - provide labels and error messages;
704
+ - move focus predictably;
705
+ - support keyboard submit where expected;
706
+ - avoid destructive submit duplication;
707
+ - disable or deduplicate in-flight requests where required;
708
+ - expose recoverable errors;
709
+ - never log secret fields.
710
+
711
+ Use `TextEditingController`, `FocusNode`, and other lifecycle-owned objects with explicit disposal when the widget owns them.
712
+
713
+ ## 15. Networking
714
+
715
+ The official Flutter guidance commonly uses the `http` package for straightforward cross-platform HTTP.
716
+
717
+ Regardless of client library:
718
+
719
+ - inject the client/service when testability benefits;
720
+ - use explicit timeouts;
721
+ - validate status codes;
722
+ - model transport errors separately from domain outcomes;
723
+ - cancel obsolete work when the chosen stack supports it;
724
+ - retry only safe transient failures;
725
+ - use idempotency strategies for repeated writes;
726
+ - never log credentials or full sensitive payloads.
727
+
728
+ Platform configuration may be required, such as Android internet permission and macOS entitlements.
729
+
730
+ ### 15.1 Network boundaries
731
+
732
+ Preferred flow:
733
+
734
+ ```text
735
+ ViewModel -> Repository -> API Service -> HTTP client
736
+ ```
737
+
738
+ The UI should not parse raw JSON.
739
+
740
+ ### 15.2 DTOs and models
741
+
742
+ Use separate DTO and domain model types when transport schemas and app semantics differ enough to justify it.
743
+
744
+ Avoid spreading `Map<String, dynamic>` through the application.
745
+
746
+ ## 16. JSON and serialization
747
+
748
+ Choose manual serialization for:
749
+
750
+ - tiny models;
751
+ - stable schemas;
752
+ - low code-generation overhead requirements.
753
+
754
+ Choose generated serialization when:
755
+
756
+ - models are numerous;
757
+ - schemas evolve;
758
+ - correctness and maintainability benefit from generated mapping;
759
+ - the project already uses a generator.
760
+
761
+ Generated code must be reproducible through a documented command.
762
+
763
+ Never hand-edit generated serialization output.
764
+
765
+ Validate untrusted data assumptions. A successful JSON parse does not prove semantic validity.
766
+
767
+ ## 17. Async work and isolates
768
+
769
+ Dart code commonly runs application work on one isolate. Expensive CPU work can block frame delivery.
770
+
771
+ Move CPU-heavy work off the UI isolate when measurement or known cost justifies it.
772
+
773
+ Examples:
774
+
775
+ - very large JSON parsing;
776
+ - image/data transformation;
777
+ - cryptographic or computational work;
778
+ - large local data processing.
779
+
780
+ `compute()` is suitable for simple isolate-offloaded functions.
781
+
782
+ Do not use isolates for ordinary async I/O merely because a function returns a `Future`. Network and file APIs are already asynchronous in typical usage.
783
+
784
+ Data passed across isolates must be transferable/serializable according to Dart isolate rules. Do not attempt to pass arbitrary active objects such as open clients or futures.
785
+
786
+ ## 18. Persistence and offline-first behavior
787
+
788
+ Select persistence based on data characteristics:
789
+
790
+ - small settings/preferences;
791
+ - secure secrets/tokens;
792
+ - structured local database;
793
+ - files/blobs;
794
+ - caches.
795
+
796
+ Do not store secrets in plain preferences when a secure platform-backed mechanism is required.
797
+
798
+ For offline-first systems, define:
799
+
800
+ - source of truth;
801
+ - freshness;
802
+ - cache invalidation;
803
+ - conflict handling;
804
+ - synchronization trigger;
805
+ - retry policy;
806
+ - user-visible offline state;
807
+ - deletion semantics.
808
+
809
+ "Works offline" is a behavioral contract and requires tests.
810
+
811
+ ## 19. Assets, images, icons, and fonts
812
+
813
+ Declare static assets predictably in `pubspec.yaml` unless the project uses another supported asset workflow.
814
+
815
+ For images:
816
+
817
+ - size assets appropriately;
818
+ - avoid decoding huge images to display tiny thumbnails;
819
+ - use cache sizing or resize hints when helpful;
820
+ - provide placeholders/error states for remote images;
821
+ - account for web CORS and hosting constraints;
822
+ - ensure meaningful images have appropriate semantics when accessibility requires it.
823
+
824
+ Use build-time asset transformation only when it is deterministic and integrated into project builds.
825
+
826
+ ## 20. Internationalization and localization
827
+
828
+ For applications with localization requirements, prefer Flutter's generated localization workflow when consistent with the project:
829
+
830
+ - `flutter_localizations`;
831
+ - ARB resources;
832
+ - `l10n.yaml`;
833
+ - generated `AppLocalizations`;
834
+ - `flutter gen-l10n` or build-triggered generation.
835
+
836
+ Keep user-visible strings out of arbitrary source files when they are part of the localization contract.
837
+
838
+ Localize more than words:
839
+
840
+ - plurals;
841
+ - dates;
842
+ - numbers;
843
+ - currencies;
844
+ - text direction;
845
+ - layout assumptions;
846
+ - semantic labels.
847
+
848
+ For Flutter web with many locales, deferred locale loading can be considered when it materially improves startup cost; measure before adopting it.
849
+
850
+ ## 21. Accessibility
851
+
852
+ Accessibility is part of completion for user-facing Flutter work.
853
+
854
+ At minimum verify relevant surfaces for:
855
+
856
+ - semantics and accessible names;
857
+ - logical focus order;
858
+ - keyboard operation where applicable;
859
+ - sufficient touch targets;
860
+ - large text/display scaling;
861
+ - color-independent meaning;
862
+ - contrast;
863
+ - error identification and correction;
864
+ - context changes;
865
+ - motion sensitivity;
866
+ - screen-reader behavior;
867
+ - orientation and responsive reflow.
868
+
869
+ Flutter guidance calls for tappable targets of at least 48x48 logical pixels in common accessible UI cases.
870
+
871
+ Do not hide a functional control from semantics unless another accessible representation exists.
872
+
873
+ Use semantic widgets and framework controls before building custom gesture-only interactions.
874
+
875
+ When a custom control is necessary, define:
876
+
877
+ - role/semantics;
878
+ - label/value;
879
+ - enabled/disabled state;
880
+ - action;
881
+ - focus behavior;
882
+ - keyboard equivalent.
883
+
884
+ ## 22. Animations and motion
885
+
886
+ Prefer the simplest animation mechanism that satisfies the behavior:
887
+
888
+ - implicit animation widgets for state-driven transitions;
889
+ - built-in transitions such as fade/slide/size;
890
+ - `AnimatedBuilder`/`AnimatedWidget` for explicit control;
891
+ - `AnimationController` when lifecycle, sequencing, or interactive control requires it.
892
+
893
+ Dispose owned animation controllers.
894
+
895
+ Avoid:
896
+
897
+ - rebuilding large subtrees per tick unnecessarily;
898
+ - animation as a substitute for clear state;
899
+ - essential information available only through motion;
900
+ - expensive clipping/layer operations without profiling.
901
+
902
+ Respect reduced-motion requirements where relevant to the product and platform.
903
+
904
+ ## 23. Platform integration
905
+
906
+ ### 23.1 Use an existing supported plugin first
907
+
908
+ Before writing native code:
909
+
910
+ 1. inspect current dependencies;
911
+ 2. evaluate an existing maintained plugin if appropriate;
912
+ 3. verify platform coverage and maintenance;
913
+ 4. inspect permissions and native behavior;
914
+ 5. prefer a project-owned wrapper around volatile or side-effecting plugins when that improves testability.
915
+
916
+ Do not add a package solely because it is popular.
917
+
918
+ ### 23.2 Platform channels
919
+
920
+ Use platform channels when Flutter must invoke native platform APIs not exposed through suitable packages.
921
+
922
+ Flutter supports platform-specific integration with languages such as:
923
+
924
+ - Android: Kotlin/Java;
925
+ - iOS: Swift/Objective-C;
926
+ - Windows: C++;
927
+ - macOS: Objective-C family;
928
+ - Linux: C/C++-oriented native integration depending on API and plugin structure.
929
+
930
+ For type-safe channel contracts, consider Pigeon when consistent with the repository.
931
+
932
+ Keep channel names stable and namespaced.
933
+
934
+ Define:
935
+
936
+ - request schema;
937
+ - response schema;
938
+ - errors;
939
+ - threading assumptions;
940
+ - lifecycle;
941
+ - cancellation or stale-result behavior.
942
+
943
+ ### 23.3 Native thread rules
944
+
945
+ Platform-channel calls have platform-thread requirements. Follow current official threading guidance for the target platform and Flutter version.
946
+
947
+ Do not run blocking native work on a platform main thread.
948
+
949
+ ### 23.4 FFI
950
+
951
+ For C interoperability, prefer the current Flutter-recommended FFI template and build-hook flow for the project's SDK version.
952
+
953
+ As of the documentation reviewed in 2026, Flutter recommends the `package_ffi` approach with build hooks for typical new C interop use cases; the older `plugin_ffi` template is legacy and remains relevant only for specific requirements.
954
+
955
+ Always verify this recommendation against the project's Flutter version before migration.
956
+
957
+ ### 23.5 Multiple Flutter engines
958
+
959
+ Plugin code must not assume one global plugin instance.
960
+
961
+ For multi-engine compatibility:
962
+
963
+ - keep engine-specific state on the plugin instance;
964
+ - clean resources when detached;
965
+ - coordinate access to shared native singletons explicitly;
966
+ - avoid static state that leaks across engine lifecycles.
967
+
968
+ ### 23.6 Federated plugins
969
+
970
+ Use federated plugin architecture when a plugin needs independently maintained platform implementations.
971
+
972
+ Separate:
973
+
974
+ - app-facing API;
975
+ - platform interface;
976
+ - platform implementations.
977
+
978
+ Do not expose platform implementation packages directly to app code without a reason.
979
+
980
+ ## 24. Add-to-app
981
+
982
+ When embedding Flutter into an existing native application:
983
+
984
+ - understand ownership of Flutter engine lifecycle;
985
+ - define navigation responsibility;
986
+ - coordinate native and Flutter state;
987
+ - avoid duplicated singleton assumptions;
988
+ - test warm/cold engine behavior;
989
+ - verify memory and startup impact;
990
+ - test platform back/navigation flows.
991
+
992
+ Treat add-to-app as an integration architecture, not just a build setting.
993
+
994
+ ## 25. Flutter Web
995
+
996
+ Flutter web is appropriate when the product benefits from Flutter's app-centric UI model and cross-platform code sharing.
997
+
998
+ ### 25.1 Web compilation
999
+
1000
+ Production Flutter web can compile to optimized web output. Current Flutter supports WebAssembly builds using:
1001
+
1002
+ ```bash
1003
+ flutter build web --wasm
1004
+ ```
1005
+
1006
+ when compatible with the project and deployment environment.
1007
+
1008
+ Do not enable Wasm only because it is newer. Verify:
1009
+
1010
+ - browser support;
1011
+ - package compatibility;
1012
+ - hosting configuration;
1013
+ - startup and runtime impact;
1014
+ - fallback requirements.
1015
+
1016
+ ### 25.2 Web navigation
1017
+
1018
+ For web targets:
1019
+
1020
+ - synchronize routes with browser URLs;
1021
+ - test back/forward;
1022
+ - support direct loading of deep URLs;
1023
+ - configure server fallback/rewrite behavior;
1024
+ - verify base href when hosting under a subpath.
1025
+
1026
+ ### 25.3 Web semantics and browser expectations
1027
+
1028
+ A Flutter web app should still behave like a web application where users expect it:
1029
+
1030
+ - keyboard navigation;
1031
+ - selectable text where appropriate;
1032
+ - URL copy/share;
1033
+ - pointer and hover;
1034
+ - focus visibility;
1035
+ - responsive layout;
1036
+ - accessible semantics.
1037
+
1038
+ ### 25.4 Web images and CORS
1039
+
1040
+ Remote images can fail because of browser CORS policy or hosting configuration even when they work on mobile.
1041
+
1042
+ Diagnose:
1043
+
1044
+ - request URL;
1045
+ - response headers;
1046
+ - canvas/rendering path;
1047
+ - image host policy;
1048
+ - browser console;
1049
+ - deployment origin.
1050
+
1051
+ Do not treat a missing image as a Flutter widget problem until the network/browser evidence supports that conclusion.
1052
+
1053
+ ## 26. Android
1054
+
1055
+ For Android-specific work, verify:
1056
+
1057
+ - `compileSdk`/`targetSdk` and Gradle/AGP/Kotlin compatibility;
1058
+ - manifest permissions;
1059
+ - app links;
1060
+ - signing;
1061
+ - flavors;
1062
+ - ProGuard/R8 rules where applicable;
1063
+ - notification/runtime permission behavior;
1064
+ - predictive back where relevant;
1065
+ - release artifact type.
1066
+
1067
+ Common release artifact:
1068
+
1069
+ ```bash
1070
+ flutter build appbundle
1071
+ ```
1072
+
1073
+ Do not modify signing secrets into tracked files.
1074
+
1075
+ ## 27. iOS and macOS
1076
+
1077
+ For Apple-platform work, verify:
1078
+
1079
+ - deployment target;
1080
+ - Xcode compatibility;
1081
+ - bundle identifiers;
1082
+ - entitlements;
1083
+ - capabilities;
1084
+ - Info.plist usage descriptions;
1085
+ - universal links/associated domains;
1086
+ - signing/provisioning;
1087
+ - privacy-sensitive SDK requirements;
1088
+ - CocoaPods or Swift Package Manager integration according to project state.
1089
+
1090
+ Do not replace an established dependency manager casually.
1091
+
1092
+ Release validation may require macOS/Xcode and valid signing credentials; report unavailable signing checks rather than simulating them.
1093
+
1094
+ ## 28. Windows and Linux
1095
+
1096
+ Desktop Flutter work must account for:
1097
+
1098
+ - resizable windows;
1099
+ - mouse/keyboard;
1100
+ - focus;
1101
+ - context menus;
1102
+ - file system behavior;
1103
+ - installers/distribution;
1104
+ - native dependencies;
1105
+ - plugin support;
1106
+ - high-DPI scaling.
1107
+
1108
+ Do not assume a mobile-first interaction remains usable on desktop.
1109
+
1110
+ ## 29. Packages and dependencies
1111
+
1112
+ Before adding or updating a package:
1113
+
1114
+ 1. determine whether Flutter/Dart SDK already provides the capability;
1115
+ 2. inspect existing dependencies;
1116
+ 3. identify supported platforms;
1117
+ 4. inspect maintenance and compatibility;
1118
+ 5. evaluate transitive impact;
1119
+ 6. understand licenses when relevant;
1120
+ 7. update only what the task requires;
1121
+ 8. run affected tests/builds.
1122
+
1123
+ Prefer explicit package constraints compatible with project policy.
1124
+
1125
+ Do not run indiscriminate major dependency upgrades while implementing an unrelated feature.
1126
+
1127
+ ### 29.1 Plugin/package authoring
1128
+
1129
+ A reusable package should expose a minimal stable public API.
1130
+
1131
+ Keep implementation under `lib/src/` where appropriate and export only intended surfaces from the package entrypoint.
1132
+
1133
+ For plugins:
1134
+
1135
+ - include platform implementations only where needed;
1136
+ - test channel boundaries;
1137
+ - support lifecycle correctly;
1138
+ - use federated architecture for independently extensible platforms when justified.
1139
+
1140
+ ## 30. Security
1141
+
1142
+ Flutter clients are untrusted clients from a server perspective.
1143
+
1144
+ Never rely on client code alone for:
1145
+
1146
+ - authorization;
1147
+ - payment validation;
1148
+ - entitlement enforcement;
1149
+ - ownership checks;
1150
+ - anti-fraud;
1151
+ - secrets.
1152
+
1153
+ Assume app binaries and web assets can be inspected.
1154
+
1155
+ ### 30.1 Secrets
1156
+
1157
+ Do not embed long-lived private secrets in Flutter apps.
1158
+
1159
+ Public client configuration is not automatically secret, but credentials that authorize privileged actions must remain server-side.
1160
+
1161
+ Never log:
1162
+
1163
+ - access tokens;
1164
+ - refresh tokens;
1165
+ - passwords;
1166
+ - personal data without explicit safe handling;
1167
+ - payment data;
1168
+ - full API responses containing sensitive content.
1169
+
1170
+ ### 30.2 Storage
1171
+
1172
+ Select storage based on data sensitivity. Authentication tokens and cryptographic material often require platform-secure storage and backend-side controls.
1173
+
1174
+ ### 30.3 TLS and certificates
1175
+
1176
+ Do not disable certificate validation to "fix" connectivity.
1177
+
1178
+ Certificate pinning, if used, must include rotation and failure strategy.
1179
+
1180
+ ### 30.4 AI features
1181
+
1182
+ If a Flutter app calls an AI provider:
1183
+
1184
+ - do not put privileged provider credentials in the client;
1185
+ - use backend mediation for production-sensitive quota, authorization, billing, or policy enforcement;
1186
+ - validate model-generated structured data;
1187
+ - design failure and malformed-output paths.
1188
+
1189
+ ## 31. Performance
1190
+
1191
+ Flutter apps are commonly performant when standard patterns are used. Optimize from evidence.
1192
+
1193
+ ### 31.1 Profile in the right mode
1194
+
1195
+ Do not diagnose production performance from debug mode.
1196
+
1197
+ Use profile mode on supported targets:
1198
+
1199
+ ```bash
1200
+ flutter run --profile
1201
+ ```
1202
+
1203
+ Use:
1204
+
1205
+ - Flutter DevTools Performance view;
1206
+ - timeline events;
1207
+ - performance overlay;
1208
+ - memory tooling;
1209
+ - CPU profiler;
1210
+ - browser tooling for Flutter web where appropriate.
1211
+
1212
+ ### 31.2 Frame budget
1213
+
1214
+ A 60 Hz display provides approximately 16 ms per frame. Faster displays provide less time.
1215
+
1216
+ Treat 16 ms as a useful mental model, not a universal target independent of refresh rate.
1217
+
1218
+ ### 31.3 Build cost
1219
+
1220
+ Reduce unnecessary rebuild cost by:
1221
+
1222
+ - extracting stable subtrees;
1223
+ - using `const` where natural;
1224
+ - watching/selecting only needed state where the state framework supports it;
1225
+ - avoiding expensive computation in `build()`;
1226
+ - keeping list/grid construction lazy.
1227
+
1228
+ ### 31.4 Expensive operations
1229
+
1230
+ Review carefully:
1231
+
1232
+ - `saveLayer`;
1233
+ - opacity;
1234
+ - clipping;
1235
+ - intrinsic layout;
1236
+ - huge image decode;
1237
+ - synchronous CPU work;
1238
+ - shader-heavy custom effects;
1239
+ - unnecessary layout passes.
1240
+
1241
+ Do not remove a visual effect solely because it can be expensive. Measure it on representative devices.
1242
+
1243
+ ### 31.5 Lists and grids
1244
+
1245
+ Prefer lazy builders for large or unknown collections.
1246
+
1247
+ Use item extents or prototypes when they materially reduce layout work and match the UI.
1248
+
1249
+ ### 31.6 Startup and bundle size
1250
+
1251
+ For startup/bundle work:
1252
+
1253
+ - establish baseline;
1254
+ - identify dominant cost;
1255
+ - measure release output;
1256
+ - consider deferred loading where supported and beneficial;
1257
+ - remove unused assets/dependencies only with evidence.
1258
+
1259
+ ### 31.7 Performance evidence
1260
+
1261
+ A performance change is not complete without:
1262
+
1263
+ - baseline;
1264
+ - scenario;
1265
+ - device/platform;
1266
+ - build mode;
1267
+ - metric;
1268
+ - after measurement;
1269
+ - functional regression check.
1270
+
1271
+ ## 32. Testing strategy
1272
+
1273
+ Flutter's main automated test levels are:
1274
+
1275
+ - unit tests;
1276
+ - widget tests;
1277
+ - integration tests.
1278
+
1279
+ A healthy application typically has many unit/widget tests and enough integration tests to cover critical user journeys.
1280
+
1281
+ ### 32.1 Unit tests
1282
+
1283
+ Use unit tests for:
1284
+
1285
+ - model transformations;
1286
+ - repository policy;
1287
+ - ViewModel logic;
1288
+ - validation;
1289
+ - error mapping;
1290
+ - pure functions;
1291
+ - caching decisions.
1292
+
1293
+ Keep real network, disk, and platform dependencies out of unit tests unless the test is explicitly an integration boundary test.
1294
+
1295
+ ### 32.2 Widget tests
1296
+
1297
+ Use widget tests for:
1298
+
1299
+ - rendering states;
1300
+ - interactions;
1301
+ - validation messages;
1302
+ - navigation triggers;
1303
+ - semantics;
1304
+ - loading/error/success UI;
1305
+ - responsive variants when practical.
1306
+
1307
+ Prefer stable semantic/findable elements over brittle text-only targeting when copy can legitimately change.
1308
+
1309
+ ### 32.3 Integration tests
1310
+
1311
+ Use integration tests for:
1312
+
1313
+ - critical user journeys;
1314
+ - route stacks;
1315
+ - real plugin integration;
1316
+ - startup;
1317
+ - cross-layer flows;
1318
+ - release-like behavior;
1319
+ - performance scenarios.
1320
+
1321
+ The official `integration_test` package integrates with Flutter test APIs and can run on target devices.
1322
+
1323
+ Where native system UI interaction is required, a framework such as Patrol may be appropriate if already part of the project or explicitly approved.
1324
+
1325
+ ### 32.4 Plugin tests
1326
+
1327
+ For plugins, test:
1328
+
1329
+ - Dart API behavior;
1330
+ - platform interface behavior;
1331
+ - native implementation where practical;
1332
+ - at least one real integration path for each important channel call/platform;
1333
+ - attach/detach lifecycle.
1334
+
1335
+ Mocking only the Dart side does not prove native communication.
1336
+
1337
+ ### 32.5 Golden tests
1338
+
1339
+ Use golden tests when visual regressions are important and the project has a stable golden workflow.
1340
+
1341
+ Golden tests require control over:
1342
+
1343
+ - fonts;
1344
+ - pixel ratio;
1345
+ - platform rendering;
1346
+ - locale;
1347
+ - animation state;
1348
+ - deterministic content.
1349
+
1350
+ Do not introduce a broad golden suite without considering maintenance cost.
1351
+
1352
+ ### 32.6 Accessibility tests
1353
+
1354
+ Automated semantics checks are useful but do not replace screen-reader, keyboard, scaling, and real interaction checks when those are relevant.
1355
+
1356
+ ## 33. Debugging
1357
+
1358
+ Diagnose before changing behavior.
1359
+
1360
+ Use evidence from:
1361
+
1362
+ - exception stack traces;
1363
+ - Flutter inspector;
1364
+ - DevTools;
1365
+ - logs;
1366
+ - network traces;
1367
+ - browser console;
1368
+ - native logs;
1369
+ - analyzer diagnostics;
1370
+ - failing tests.
1371
+
1372
+ ### 33.1 Common layout failures
1373
+
1374
+ For overflow or unbounded constraints:
1375
+
1376
+ 1. identify the offending render object;
1377
+ 2. trace parent constraints;
1378
+ 3. determine which axis is bounded;
1379
+ 4. inspect scroll/flex nesting;
1380
+ 5. make the smallest layout correction;
1381
+ 6. test relevant sizes/text scales.
1382
+
1383
+ ### 33.2 Async lifecycle failures
1384
+
1385
+ Before calling `setState` or using context after an `await`, verify that the owner is still valid.
1386
+
1387
+ For widget state, use `mounted`/`context.mounted` as appropriate to the code pattern and Flutter version.
1388
+
1389
+ Prefer moving long-lived async state to a ViewModel/repository rather than accumulating lifecycle guards in views.
1390
+
1391
+ ### 33.3 Duplicate work
1392
+
1393
+ If a request fires repeatedly, investigate:
1394
+
1395
+ - work started from `build()`;
1396
+ - listener registered multiple times;
1397
+ - provider/bloc recreated unexpectedly;
1398
+ - route rebuild;
1399
+ - retry loop;
1400
+ - missing in-flight guard.
1401
+
1402
+ Fix ownership rather than merely debouncing symptoms unless debouncing is the intended UX.
1403
+
1404
+ ## 34. Tooling and code quality
1405
+
1406
+ Use project-provided commands first.
1407
+
1408
+ Typical Flutter/Dart checks:
1409
+
1410
+ ```bash
1411
+ dart format --output=none --set-exit-if-changed .
1412
+ flutter analyze
1413
+ flutter test
1414
+ ```
1415
+
1416
+ Potential project checks:
1417
+
1418
+ ```bash
1419
+ flutter test --coverage
1420
+ flutter test integration_test
1421
+ flutter build web
1422
+ flutter build apk
1423
+ flutter build appbundle
1424
+ flutter build ios --no-codesign
1425
+ flutter build macos
1426
+ flutter build windows
1427
+ flutter build linux
1428
+ ```
1429
+
1430
+ Run only checks supported by the host OS, installed toolchain, project targets, and authority.
1431
+
1432
+ ### 34.1 Analyzer
1433
+
1434
+ Treat analyzer errors as blocking for changed code.
1435
+
1436
+ Warnings and lints should follow repository policy. Do not mass-suppress lints to make CI green.
1437
+
1438
+ Prefer fixing the cause.
1439
+
1440
+ ### 34.2 Formatting
1441
+
1442
+ Use Dart formatting rather than manually aligning code against formatter output.
1443
+
1444
+ ### 34.3 Flutter Fix
1445
+
1446
+ `dart fix` / Flutter migration tooling can help with mechanical migrations, but inspect the diff before accepting it.
1447
+
1448
+ Do not run repository-wide automated fixes for an unrelated local task without scope justification.
1449
+
1450
+ ## 35. DevTools
1451
+
1452
+ Use Flutter/Dart DevTools as evidence-producing tools.
1453
+
1454
+ Relevant views include:
1455
+
1456
+ - Inspector;
1457
+ - Performance;
1458
+ - CPU profiler;
1459
+ - Memory;
1460
+ - Network where supported;
1461
+ - Debugger;
1462
+ - logging;
1463
+ - app-size tooling in appropriate workflows.
1464
+
1465
+ Use the tool that answers the current hypothesis; do not collect traces without a question.
1466
+
1467
+ ## 36. Build modes
1468
+
1469
+ Use:
1470
+
1471
+ - debug for development and hot reload;
1472
+ - profile for performance investigation;
1473
+ - release for production-like output.
1474
+
1475
+ Do not compare debug timing against release goals.
1476
+
1477
+ Assertions and diagnostics differ by mode. Tests that depend on debug-only behavior are not release validation.
1478
+
1479
+ ## 37. CI/CD
1480
+
1481
+ A Flutter CI pipeline should be proportional to project risk.
1482
+
1483
+ A common order is:
1484
+
1485
+ ```text
1486
+ dependency resolution
1487
+ -> generated-code verification
1488
+ -> formatting
1489
+ -> static analysis
1490
+ -> unit/widget tests
1491
+ -> targeted integration tests
1492
+ -> target build
1493
+ -> packaging/signing/release
1494
+ ```
1495
+
1496
+ Do not run every platform build on every commit if it creates disproportionate cost without meaningful risk reduction. Use local/pre-merge/release separation according to ForgeLoop policy and repository needs.
1497
+
1498
+ ### 37.1 Generated code in CI
1499
+
1500
+ Choose and document one policy:
1501
+
1502
+ - generated code is committed and CI verifies it is current; or
1503
+ - generated code is produced deterministically in CI.
1504
+
1505
+ Do not leave generated-source ownership ambiguous.
1506
+
1507
+ ### 37.2 Flavors
1508
+
1509
+ Use flavors when the app genuinely needs separate:
1510
+
1511
+ - identifiers;
1512
+ - endpoints;
1513
+ - configuration;
1514
+ - icons/names;
1515
+ - entitlements;
1516
+ - release channels.
1517
+
1518
+ Do not encode production secrets into flavor files.
1519
+
1520
+ ## 38. Deployment
1521
+
1522
+ Validate the actual target.
1523
+
1524
+ ### Android
1525
+
1526
+ Potential evidence:
1527
+
1528
+ ```bash
1529
+ flutter build appbundle --release
1530
+ ```
1531
+
1532
+ ### Web
1533
+
1534
+ Potential evidence:
1535
+
1536
+ ```bash
1537
+ flutter build web
1538
+ ```
1539
+
1540
+ or, when intentionally supported:
1541
+
1542
+ ```bash
1543
+ flutter build web --wasm
1544
+ ```
1545
+
1546
+ Test the built files through a real HTTP server, not only `file://`.
1547
+
1548
+ ### Apple platforms
1549
+
1550
+ Release validation depends on Xcode, signing, provisioning, entitlements, and App Store configuration.
1551
+
1552
+ A no-codesign build can prove compilation in some situations but does not prove App Store readiness.
1553
+
1554
+ ### Desktop
1555
+
1556
+ Verify installation/distribution expectations, native dependencies, signing where required, and behavior under resize/input conventions.
1557
+
1558
+ ## 39. AI-assisted Flutter development
1559
+
1560
+ Current Flutter documentation includes official AI-development support.
1561
+
1562
+ The ecosystem includes:
1563
+
1564
+ - Flutter/Dart agent skills;
1565
+ - Dart and Flutter MCP server;
1566
+ - Developer Knowledge MCP;
1567
+ - package-provided skills;
1568
+ - specialized agents such as accessibility-focused workflows.
1569
+
1570
+ ### 39.1 ForgeLoop usage
1571
+
1572
+ ForgeLoop may benefit from official Flutter/Dart agent tooling when already available or explicitly authorized.
1573
+
1574
+ The specialist SHOULD prefer live project evidence from analyzer/test/runtime tooling over model memory.
1575
+
1576
+ Do not automatically install external agent tooling.
1577
+
1578
+ ### 39.2 Progressive disclosure
1579
+
1580
+ For large Flutter tasks:
1581
+
1582
+ 1. detect the relevant domain;
1583
+ 2. load only the necessary guide sections;
1584
+ 3. inspect project state;
1585
+ 4. run targeted tooling;
1586
+ 5. expand context only when evidence requires it.
1587
+
1588
+ This matches both ForgeLoop's selective guide routing and Flutter's current AI-skill direction.
1589
+
1590
+ ### 39.3 Package skills
1591
+
1592
+ A package may ship AI guidance with its package. Treat package skills as package-specific documentation, not higher authority than:
1593
+
1594
+ - repository instructions;
1595
+ - actual API version;
1596
+ - project tests;
1597
+ - official package source.
1598
+
1599
+ ## 40. Dependency and package selection policy
1600
+
1601
+ When choosing among packages, evaluate:
1602
+
1603
+ | Dimension | Question |
1604
+ | --- | --- |
1605
+ | Need | Does the SDK or current project already solve this? |
1606
+ | Scope | Is the package proportional to the requirement? |
1607
+ | Compatibility | Does it support the project's Flutter/Dart constraints? |
1608
+ | Platforms | Does it support every required target? |
1609
+ | Maintenance | Is it actively maintained enough for this risk? |
1610
+ | API | Does it produce a stable, testable boundary? |
1611
+ | Native impact | Does it add permissions, SDKs, build steps, or entitlements? |
1612
+ | Security | Does it introduce credential or data-handling risk? |
1613
+ | Size/performance | Is startup/bundle/runtime cost material? |
1614
+ | Testability | Can behavior be verified without fragile global state? |
1615
+ | Exit cost | Can it be wrapped/replaced if needed? |
1616
+
1617
+ Do not choose dependencies by popularity alone.
1618
+
1619
+ ## 41. Code generation
1620
+
1621
+ Common generated-code categories include:
1622
+
1623
+ - JSON serialization;
1624
+ - localization;
1625
+ - routing;
1626
+ - immutable models;
1627
+ - dependency injection;
1628
+ - database code.
1629
+
1630
+ For any generator:
1631
+
1632
+ - keep source-of-truth files clear;
1633
+ - document the command;
1634
+ - make output deterministic;
1635
+ - verify generated output is current;
1636
+ - avoid editing generated files;
1637
+ - avoid triggering unrelated repository-wide generation unless needed.
1638
+
1639
+ ## 42. Error handling
1640
+
1641
+ Errors should cross layers intentionally.
1642
+
1643
+ Example policy:
1644
+
1645
+ ```text
1646
+ transport exception
1647
+ -> service-level failure
1648
+ -> repository normalization
1649
+ -> app/domain error
1650
+ -> ViewModel state
1651
+ -> user-visible safe message/action
1652
+ ```
1653
+
1654
+ Do not display raw exception strings to users.
1655
+
1656
+ Do not erase useful diagnostic classification by turning every failure into `"Something went wrong"` internally.
1657
+
1658
+ Use safe structured diagnostics while keeping sensitive values out of logs.
1659
+
1660
+ ## 43. Lifecycle and resource ownership
1661
+
1662
+ Every long-lived resource needs an owner.
1663
+
1664
+ Examples:
1665
+
1666
+ - `AnimationController`;
1667
+ - `TextEditingController`;
1668
+ - `FocusNode`;
1669
+ - `ScrollController`;
1670
+ - stream subscription;
1671
+ - timers;
1672
+ - native handles;
1673
+ - database clients;
1674
+ - event listeners.
1675
+
1676
+ Ownership rules:
1677
+
1678
+ - create at a deterministic lifecycle boundary;
1679
+ - dispose/cancel at the matching boundary;
1680
+ - do not share a disposable object accidentally between unrelated owners;
1681
+ - prevent callbacks into disposed objects.
1682
+
1683
+ ## 44. Background execution
1684
+
1685
+ Differentiate:
1686
+
1687
+ - isolate computation;
1688
+ - application background execution;
1689
+ - operating-system scheduled work;
1690
+ - background notifications;
1691
+ - foreground services.
1692
+
1693
+ A Dart isolate does not by itself grant unrestricted execution while an app is backgrounded or terminated.
1694
+
1695
+ For OS background work, use platform-supported mechanisms and a compatible plugin/native integration.
1696
+
1697
+ Define platform constraints explicitly.
1698
+
1699
+ ## 45. Observability
1700
+
1701
+ Client observability must be useful and safe.
1702
+
1703
+ Prefer structured events such as:
1704
+
1705
+ ```text
1706
+ event: profile.load.completed
1707
+ result: success
1708
+ duration_ms: 142
1709
+ request_id: ...
1710
+ source: cache
1711
+ ```
1712
+
1713
+ Never send sensitive values merely because telemetry is encrypted in transit.
1714
+
1715
+ Record:
1716
+
1717
+ - user-visible failure class;
1718
+ - integration result;
1719
+ - duration;
1720
+ - version/build;
1721
+ - platform;
1722
+ - already-redacted context.
1723
+
1724
+ Do not emit raw state snapshots by default.
1725
+
1726
+ ## 46. Recommended implementation playbook
1727
+
1728
+ For a normal Flutter feature:
1729
+
1730
+ 1. Read ForgeLoop project instructions.
1731
+ 2. Confirm Flutter/Dart versions and targets.
1732
+ 3. Identify the current architecture and state-management pattern.
1733
+ 4. Activate `flutter` plus required complementary ForgeLoop guides.
1734
+ 5. Define behavior and acceptance evidence.
1735
+ 6. Locate the smallest feature boundary.
1736
+ 7. Add or update model/service/repository boundaries only when needed.
1737
+ 8. Implement ViewModel/state behavior.
1738
+ 9. Implement UI using existing design system.
1739
+ 10. Add accessibility semantics and adaptive behavior as required.
1740
+ 11. Add unit/widget tests.
1741
+ 12. Add integration coverage only for critical cross-layer behavior.
1742
+ 13. Format and analyze.
1743
+ 14. Run targeted tests.
1744
+ 15. Run proportional regressions.
1745
+ 16. Build the affected target when feasible.
1746
+ 17. Report unavailable target/signing/device checks explicitly.
1747
+ 18. Complete the ForgeLoop lifecycle with structured evidence.
1748
+
1749
+ ## 47. Bug-fix playbook
1750
+
1751
+ 1. Reproduce the failure.
1752
+ 2. Capture the smallest evidence that demonstrates it.
1753
+ 3. Identify whether the fault is:
1754
+ - UI/layout;
1755
+ - state ownership;
1756
+ - async lifecycle;
1757
+ - routing;
1758
+ - serialization;
1759
+ - repository/service;
1760
+ - plugin/native;
1761
+ - platform configuration;
1762
+ - deployment/hosting.
1763
+ 4. Add a regression test at the lowest level that proves the real failure.
1764
+ 5. Change the smallest owning layer.
1765
+ 6. Run the regression test.
1766
+ 7. Run proportional adjacent tests.
1767
+ 8. Build/launch affected target when required.
1768
+ 9. Do not refactor unrelated Flutter architecture inside the bug fix unless necessary for correctness.
1769
+
1770
+ ## 48. Performance-fix playbook
1771
+
1772
+ 1. Reproduce in profile/release-appropriate mode.
1773
+ 2. Record device, build mode, scenario, and baseline.
1774
+ 3. Use DevTools/browser/native profiling to identify the bottleneck.
1775
+ 4. Form one hypothesis.
1776
+ 5. Make one coherent optimization.
1777
+ 6. Rerun the same measurement.
1778
+ 7. Verify visual/functional behavior.
1779
+ 8. Keep the change only when the evidence supports it.
1780
+
1781
+ ## 49. Platform-integration playbook
1782
+
1783
+ 1. Verify no suitable current project abstraction exists.
1784
+ 2. Verify package/plugin options before custom native code.
1785
+ 3. Define the Dart-facing contract.
1786
+ 4. Define platform error behavior.
1787
+ 5. Implement platform-specific code.
1788
+ 6. Test Dart behavior with fakes/mocks.
1789
+ 7. Add integration coverage for the real boundary.
1790
+ 8. Test attach/detach and lifecycle.
1791
+ 9. Verify permissions/entitlements.
1792
+ 10. Build every affected target that the environment supports.
1793
+
1794
+ ## 50. Web-fix playbook
1795
+
1796
+ For web-only failures:
1797
+
1798
+ 1. reproduce in a supported browser;
1799
+ 2. inspect browser console;
1800
+ 3. inspect network requests and response headers;
1801
+ 4. verify route/base-path hosting;
1802
+ 5. verify CORS;
1803
+ 6. verify service worker/cache behavior when relevant;
1804
+ 7. compare debug versus production build behavior;
1805
+ 8. test direct deep URL load;
1806
+ 9. test back/forward;
1807
+ 10. verify responsive and keyboard behavior.
1808
+
1809
+ Do not assume a bug is in Flutter framework code until browser and deployment evidence are ruled out.
1810
+
1811
+ ## 51. Review anti-patterns
1812
+
1813
+ | Anti-pattern | Why it is risky | Required action |
1814
+ | --- | --- | --- |
1815
+ | Network request in `build()` | Rebuilds can duplicate effects | Move work to lifecycle/ViewModel/repository boundary |
1816
+ | Business logic in widgets | Hard to test and reuse | Move to ViewModel/domain/repository |
1817
+ | `Map<String, dynamic>` everywhere | Weak contracts and runtime failures | Introduce typed DTO/model boundaries |
1818
+ | Global mutable singleton state | Hidden coupling/lifecycle bugs | Make ownership and injection explicit |
1819
+ | New state library per feature | Inconsistent architecture | Reuse established project state management |
1820
+ | Named routes for complex web/deep-link apps | Limited route/deep-link behavior | Prefer Router-based/declarative routing when migration is justified |
1821
+ | `UniqueKey()` as a rebuild fix | Destroys identity/state | Fix ownership/key semantics |
1822
+ | `SingleChildScrollView` + huge `Column` | Eager layout and memory cost | Use lazy list/grid/slivers |
1823
+ | `IntrinsicHeight/Width` everywhere | Extra layout passes | Redesign constraints; use intrinsic sizing only when justified |
1824
+ | CPU-heavy parsing on UI isolate | Frame jank | Measure and use `compute()`/isolate when needed |
1825
+ | Performance testing in debug mode | Misleading results | Profile in profile/release-appropriate mode |
1826
+ | Raw exception shown to user | Leaks internals and poor UX | Normalize errors and expose safe messages |
1827
+ | Sensitive value embedded in app | Client binaries are inspectable | Keep privileged credentials server-side |
1828
+ | Client-only authorization | Bypassable | Enforce authorization server-side |
1829
+ | Blind dependency upgrade | Large unrelated risk | Update only required packages and test impact |
1830
+ | Hand-edit generated code | Regeneration destroys change | Edit source schema/config and regenerate |
1831
+ | Platform folder existence treated as support | Generated folders can be unused | Confirm actual target from build/release evidence |
1832
+ | Ignoring text scaling | Breaks accessibility | Test large scale and responsive reflow |
1833
+ | Custom gesture control without semantics | Inaccessible | Use standard controls or implement semantics/focus/actions |
1834
+ | Plugin assumes one Flutter engine | Lifecycle/global-state bugs | Keep engine-specific state per plugin instance |
1835
+ | Random `setState` after `await` | Disposed-context failures | Check ownership/mounted or move async state out of view |
1836
+ | Blanket `catch (_) {}` | Hides failures | Handle expected errors and preserve diagnostic class |
1837
+ | Unbounded retry | Battery/network/server harm | Bound retries and use idempotency |
1838
+ | Wasm enabled without compatibility evidence | Browser/package regressions | Validate support and measure |
1839
+ | `adb` deep-link test treated as full app-link proof | Does not prove hosted association | Test hosted association and real external link |
1840
+ | No release build evidence | Debug success is insufficient | Build affected target when feasible |
1841
+ | Mass lint suppression | Hides defects | Fix root causes or document narrow exception |
1842
+
1843
+ ## 52. Definition of Done
1844
+
1845
+ A Flutter task is complete only when the applicable items are satisfied.
1846
+
1847
+ ### Repository understanding
1848
+
1849
+ - [ ] Flutter and Dart versions were identified or marked unknown.
1850
+ - [ ] Actual target platforms were confirmed.
1851
+ - [ ] Current architecture, router, and state-management strategy were respected.
1852
+ - [ ] Generated code and native integration surfaces were identified.
1853
+
1854
+ ### Architecture
1855
+
1856
+ - [ ] UI, state, data, and external effects have clear owners.
1857
+ - [ ] No unnecessary new state-management or architecture framework was introduced.
1858
+ - [ ] Dependencies are injectable/testable where risk justifies it.
1859
+ - [ ] Resource lifecycle and disposal are correct.
1860
+
1861
+ ### UI
1862
+
1863
+ - [ ] Layout follows Flutter constraint semantics.
1864
+ - [ ] Loading, empty, error, success, and disabled states are handled when relevant.
1865
+ - [ ] Adaptive behavior was tested at relevant sizes/platforms.
1866
+ - [ ] Platform idioms were considered.
1867
+
1868
+ ### Accessibility
1869
+
1870
+ - [ ] Semantic names/roles/actions are available.
1871
+ - [ ] Touch/interaction targets are adequate.
1872
+ - [ ] Keyboard/focus behavior works where relevant.
1873
+ - [ ] Text/display scaling does not break task completion.
1874
+ - [ ] Color is not the only carrier of meaning.
1875
+ - [ ] Reduced-motion behavior was considered when motion is substantial.
1876
+
1877
+ ### Data and integration
1878
+
1879
+ - [ ] External data is validated and typed.
1880
+ - [ ] Network errors and timeouts are handled.
1881
+ - [ ] Sensitive values are not logged.
1882
+ - [ ] Native permissions/entitlements are correct.
1883
+ - [ ] Plugin/channel lifecycle is tested when changed.
1884
+
1885
+ ### Navigation
1886
+
1887
+ - [ ] Route parameters and redirects are valid.
1888
+ - [ ] Deep-link behavior is verified when changed.
1889
+ - [ ] Web back/forward and direct URL loading are verified for web route changes.
1890
+ - [ ] Platform app/universal-link association is verified when relevant.
1891
+
1892
+ ### Performance
1893
+
1894
+ - [ ] No expensive work was introduced into `build()`.
1895
+ - [ ] Large collections use an appropriate lazy strategy.
1896
+ - [ ] Performance claims have profile/release evidence.
1897
+ - [ ] CPU-heavy work is offloaded only when justified.
1898
+
1899
+ ### Tests
1900
+
1901
+ - [ ] A regression test exists for a bug fix when feasible.
1902
+ - [ ] Unit tests cover logic changes.
1903
+ - [ ] Widget tests cover changed UI behavior.
1904
+ - [ ] Integration tests cover critical cross-layer/platform behavior when warranted.
1905
+ - [ ] Plugin-native calls have real integration evidence when changed.
1906
+
1907
+ ### Tooling
1908
+
1909
+ - [ ] Formatting passed or is explicitly blocked.
1910
+ - [ ] `flutter analyze` passed or is explicitly blocked.
1911
+ - [ ] Targeted tests passed.
1912
+ - [ ] Proportional regression tests passed.
1913
+ - [ ] A build for the affected target passed when feasible.
1914
+ - [ ] Unavailable signing/device/platform checks are reported as `NOT_VERIFIED`.
1915
+
1916
+ ### Release and ForgeLoop
1917
+
1918
+ - [ ] Release-sensitive configuration was reviewed.
1919
+ - [ ] No secret was added to tracked client code.
1920
+ - [ ] ForgeLoop evidence records the actual commands and outcomes.
1921
+ - [ ] Completion is not claimed beyond available evidence.
1922
+
1923
+ ## 53. ForgeLoop guide routing integration
1924
+
1925
+ This file is designed to live at:
1926
+
1927
+ ```text
1928
+ ENG/flutter-development-eng.md
1929
+ ```
1930
+
1931
+ To make the current ForgeLoop `GUIDE_ROUTER.md` select it automatically, the repository should add a canonical catalog entry similar to:
1932
+
1933
+ ```markdown
1934
+ | `flutter` | [Flutter development](ENG/flutter-development-eng.md) | Architecture, UI, state, platform integration, testing, performance, and release for Flutter applications |
1935
+ ```
1936
+
1937
+ Add a domain rule similar to:
1938
+
1939
+ ```markdown
1940
+ ### `flutter` — Flutter application engineering
1941
+
1942
+ Activate when: designing, implementing, testing, debugging, profiling, integrating, or releasing a Flutter or Dart application where Flutter is an actual project stack.
1943
+
1944
+ Do not activate merely because: documentation mentions Flutter, a generated Flutter example exists, or a dependency name contains "flutter" without the affected application being a Flutter project.
1945
+
1946
+ Usually combine with: `clean` and `test`; add `design` and `accessibility` for user-facing UI, `security` for networking/auth/data/plugins/release, and `performance` for rendering/startup/memory/network critical paths.
1947
+
1948
+ rg -n '^## |architecture|ViewModel|state|widget|layout|navigation|deep link|network|serialization|isolate|platform|plugin|FFI|web|accessibility|performance|test|release|Definition of Done' ENG/flutter-development-eng.md
1949
+
1950
+ Expected evidence: Flutter/Dart version awareness, architecture-consistent implementation, analyzer/test evidence, accessibility/adaptive checks for UI, platform-boundary validation where changed, and an affected-target build when feasible.
1951
+ ```
1952
+
1953
+ The deterministic router may also need an explicit stack signal or routing rule if the current schema cannot identify Flutter from verified project manifests. Do not make natural-language string matching the sole proof that a project is Flutter. A strong deterministic signal is the presence and parsed content of `pubspec.yaml` with an actual Flutter SDK dependency, combined with affected surfaces/platform signals.
1954
+
1955
+ ## 54. Suggested deterministic Flutter stack evidence
1956
+
1957
+ A repository can be classified as Flutter when evidence such as the following is confirmed:
1958
+
1959
+ ```yaml
1960
+ dependencies:
1961
+ flutter:
1962
+ sdk: flutter
1963
+ ```
1964
+
1965
+ Useful supporting signals:
1966
+
1967
+ - `.metadata` identifies a Flutter project;
1968
+ - Flutter platform runners exist and are part of build/release configuration;
1969
+ - `flutter_test` is present under development dependencies;
1970
+ - CI invokes Flutter tooling.
1971
+
1972
+ Do not classify as Flutter only because a lockfile contains a transitive package with "flutter" in its name.
1973
+
1974
+ ## 55. Suggested completion evidence identifiers
1975
+
1976
+ If ForgeLoop's evidence schema is extended for Flutter, useful semantic identifiers may include:
1977
+
1978
+ ```text
1979
+ flutter-format
1980
+ flutter-analyze
1981
+ flutter-unit-widget-tests
1982
+ flutter-integration-tests
1983
+ flutter-target-build
1984
+ flutter-accessibility-validation
1985
+ flutter-performance-profile
1986
+ flutter-native-integration
1987
+ flutter-deep-link-validation
1988
+ ```
1989
+
1990
+ Do not add identifiers to ForgeLoop protocol schemas without updating validators, tests, documentation, and compatibility surfaces together.
1991
+
1992
+ ## 56. Official documentation map
1993
+
1994
+ Primary official Flutter documentation areas used to synthesize this guide:
1995
+
1996
+ - Flutter documentation home
1997
+ `https://docs.flutter.dev/`
1998
+ - Learn Flutter
1999
+ `https://docs.flutter.dev/learn`
2000
+ - Architectural overview
2001
+ `https://docs.flutter.dev/resources/architectural-overview`
2002
+ - App architecture
2003
+ `https://docs.flutter.dev/app-architecture`
2004
+ - Architecture guide
2005
+ `https://docs.flutter.dev/app-architecture/guide`
2006
+ - Architecture design patterns
2007
+ `https://docs.flutter.dev/app-architecture/design-patterns`
2008
+ - State management
2009
+ `https://docs.flutter.dev/data-and-backend/state-mgmt`
2010
+ - Data and backend
2011
+ `https://docs.flutter.dev/data-and-backend`
2012
+ - Networking
2013
+ `https://docs.flutter.dev/data-and-backend/networking`
2014
+ - Serialization
2015
+ `https://docs.flutter.dev/data-and-backend/serialization`
2016
+ - Persistence
2017
+ `https://docs.flutter.dev/data-and-backend/persistence`
2018
+ - Widget catalog
2019
+ `https://docs.flutter.dev/ui/widgets`
2020
+ - Layout constraints
2021
+ `https://docs.flutter.dev/ui/layout/constraints`
2022
+ - Adaptive and responsive design
2023
+ `https://docs.flutter.dev/ui/adaptive-responsive`
2024
+ - Accessibility
2025
+ `https://docs.flutter.dev/ui/accessibility`
2026
+ - Internationalization
2027
+ `https://docs.flutter.dev/ui/internationalization`
2028
+ - Navigation and routing
2029
+ `https://docs.flutter.dev/ui/navigation`
2030
+ - Deep linking
2031
+ `https://docs.flutter.dev/ui/navigation/deep-linking`
2032
+ - Animations
2033
+ `https://docs.flutter.dev/ui/animations`
2034
+ - Assets
2035
+ `https://docs.flutter.dev/ui/assets`
2036
+ - Platform integration
2037
+ `https://docs.flutter.dev/platform-integration`
2038
+ - Platform channels
2039
+ `https://docs.flutter.dev/platform-integration/platform-channels`
2040
+ - Web support
2041
+ `https://docs.flutter.dev/platform-integration/web`
2042
+ - Desktop support
2043
+ `https://docs.flutter.dev/platform-integration/desktop`
2044
+ - Packages and plugins
2045
+ `https://docs.flutter.dev/packages-and-plugins`
2046
+ - Developing packages/plugins
2047
+ `https://docs.flutter.dev/packages-and-plugins/developing-packages`
2048
+ - Testing and debugging
2049
+ `https://docs.flutter.dev/testing`
2050
+ - Testing overview
2051
+ `https://docs.flutter.dev/testing/overview`
2052
+ - Integration tests
2053
+ `https://docs.flutter.dev/testing/integration-tests`
2054
+ - Performance best practices
2055
+ `https://docs.flutter.dev/perf/best-practices`
2056
+ - Performance profiling
2057
+ `https://docs.flutter.dev/perf/ui-performance`
2058
+ - Deployment
2059
+ `https://docs.flutter.dev/deployment`
2060
+ - Web deployment
2061
+ `https://docs.flutter.dev/deployment/web`
2062
+ - Tools and techniques
2063
+ `https://docs.flutter.dev/tools`
2064
+ - Flutter pubspec options
2065
+ `https://docs.flutter.dev/tools/pubspec`
2066
+ - Flutter and AI
2067
+ `https://docs.flutter.dev/ai`
2068
+ - AI development setup
2069
+ `https://docs.flutter.dev/ai/get-started`
2070
+ - Flutter/Dart agent skills
2071
+ `https://docs.flutter.dev/ai/agent-skills`
2072
+ - Flutter AI tooling architecture
2073
+ `https://docs.flutter.dev/ai/tools`
2074
+
2075
+ ## 57. Freshness policy
2076
+
2077
+ Because Flutter documentation and SDK behavior evolve:
2078
+
2079
+ - review this guide after major Flutter stable releases;
2080
+ - review immediately when a project upgrades Flutter across significant versions;
2081
+ - verify deprecated APIs against the project's actual SDK;
2082
+ - prefer official migration guidance over stale blog posts;
2083
+ - update the `last-reviewed` field when the guide is materially revalidated;
2084
+ - do not silently rewrite historical project constraints to current defaults.
2085
+
2086
+ For tasks involving an API known to have changed recently, the agent should consult the current official documentation instead of relying solely on this guide.
2087
+
2088
+ ## 58. Summary
2089
+
2090
+ A strong Flutter implementation is not defined by using the newest package or the largest architecture.
2091
+
2092
+ It is defined by:
2093
+
2094
+ - correct state ownership;
2095
+ - predictable widget composition;
2096
+ - explicit data and platform boundaries;
2097
+ - architecture appropriate to project scale;
2098
+ - accessible and adaptive interfaces;
2099
+ - version-aware platform integration;
2100
+ - measured performance;
2101
+ - proportional automated testing;
2102
+ - reproducible builds;
2103
+ - safe release configuration;
2104
+ - evidence-backed completion.
2105
+
2106
+ For ForgeLoop, Flutter expertise should remain a selectively loaded domain guide. Activate it from verified project evidence, combine it with the relevant risk guides, and complete work only to the level actually proven by analyzer, tests, platform checks, and builds.