SuperAPI AI 工具集

moai-lang-flutter

编程与开发

查看项目

更新于 10-16 01:18

技能介绍

用途:该技能面向 Flutter 3.24+ 与 Dart 3.5+ 的跨平台应用开发,可在 Flutter 项目(.dart 文件、pubspec.yaml)中自动触发,辅助组件开发与跨平台模式实现。

主要能力:涵盖 Dart 3.5 的 patterns、records、sealed classes、extension types;Flutter 3.24 的 widget tree、Material 3 与自适应布局;Riverpod 状态管理(含代码生成);go_router 声明式导航与深链接;平台通道实现 iOS/Android 原生集成;以及 flutter_test、widget_test、integration_test 测试。

使用方式:Riverpod 通过 @riverpod 注解与生成文件定义 provider,在 ConsumerWidget 中用 ref.watch 观察、AsyncValue.when 处理数据/加载/错误,ref.invalidate 刷新,ref.listen 处理副作用。go_router 通过 GoRoute 配置路由、ShellRoute 保持导航壳,redirect 处理鉴权跳转,context.go 与 context.pop 导航。平台通道用 MethodChannel/EventChannel 调用原生方法并处理 PlatformException。自适应布局按宽度断点(600、840 像素)切换 NavigationBar、NavigationRail、NavigationDrawer。测试用 ProviderContainer 覆盖 mock provider,配合 UncontrolledProviderScope 与 pumpAndSettle 断言状态。

适用场景:跨平台移动应用、组件开发、状态管理与导航架构、原生能力集成及测试。

限制:资料未提供收费、价格、平台支持范围与效果数据;高级模式(动画、Isolates、FFI、自定义渲染等)仅指向 reference 文档,具体内容暂未提供。