跪拜 Guibai
← All articles
Frontend · Architecture · Flutter

FlutterKit Ships a GetX Scaffold With 98% Test Coverage and AI-Ready Structure

By JokerX ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

A Flutter scaffold with 98% line coverage and explicit AI-assistance files removes the first two weeks of project setup — networking, pagination, database, and navigation wiring — while giving AI coding tools enough structural context to generate features that respect the architecture rather than bypass it.

Summary

FlutterKit packages a full Flutter application skeleton around GetX, Dio, Retrofit, sqflite, and TDesign Flutter. It ships with seven core capability modules — network requests, paginated lists, state management, navigation, screen adaptation, local database, and lightweight storage — each backed by runnable demo pages and documented online. The architecture enforces a strict dependency direction: Feature modules depend on Core through Repository interfaces, never directly on network or database layers, and Core never references Feature code.

Every Core and Demo module carries unit tests with line coverage no lower than 98% and branch coverage no lower than 95%. The project also includes a project-level AGENTS.md and specialized Skills for UI, data, navigation, theming, and previews, explicitly designed so AI coding assistants can operate within the framework's architectural boundaries.

Screen adaptation handles phones, foldables, tablets, and landscape/portrait switching through four responsive breakpoints (XS, SM, MD, LG) plus flutter_screenutil. Dark mode, Chinese/English internationalization, and persistent user preferences are built in from the start.

Takeaways
Seven core modules — networking, paginated lists, state management, navigation, screen adaptation, database, and local storage — come pre-wired and documented.
Unit-test coverage reaches 98% line and 95% branch across Core and Demo modules.
The architecture enforces Feature → Repository → DataSource layering; Feature modules never import network or database code directly.
Responsive breakpoints (XS, SM, MD, LG) plus flutter_screenutil handle phones, foldables, tablets, and orientation changes.
Dark mode, Chinese/English internationalization, and persistent user preferences are built in.
A project-level AGENTS.md and specialized Skills files are included to guide AI coding assistants within the framework's boundaries.
Navigation uses type-safe route parameters, result callbacks, and GetMiddleware route guards with Android predictive back support.
Conclusions

Shipping a scaffold with 98% line coverage is unusual for open-source Flutter projects and sets a higher baseline than most commercial app templates.

The explicit AGENTS.md and Skill files signal a shift in how scaffolds are designed: they now target AI tooling as a first-class consumer, not just human developers.

Enforcing that Feature modules never import network or database code directly — only through Repository — is a discipline many Flutter projects claim but few enforce structurally; here it's baked into the module layout.

Concepts & terms
GetX
A Flutter framework combining state management (Rx, Obx), dependency injection (Get.put, Get.find), and route management (GetPage, GetMiddleware) in a single package, often used for its low boilerplate.
TDesign Flutter
Tencent's open-source Flutter UI component library providing pre-built widgets following TDesign's design system, used here as the visual foundation for all demo pages.
AGENTS.md
A project-level markdown file that describes the codebase's architecture, conventions, and boundaries to AI coding assistants so they can generate code that follows the project's rules.
Retrofit (Dart)
A Dart code generator that produces type-safe HTTP client code from annotated abstract classes, working on top of Dio to declare API interfaces rather than writing request logic by hand.
From the discussion
Featured comments
高成酱

Impressive, big shot. It'd be even better if you swapped out GetX.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗