Help us improve
Share bugs, ideas, or general feedback.
From flutter
Flutter/Dart 核心开发规范。涵盖 Dart 3.x 语法特性、Flutter 3.x 工具链配置、命名约定与项目结构模板。适用于新建 Flutter 项目、配置构建环境、编写 Dart 代码时加载。
npx claudepluginhub lazygophers/ccplugin --plugin flutterHow this skill is triggered — by the user, by Claude, or both
Slash command
/flutter:coresonnetThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
| Agent | 说明 |
Provides expert Flutter/Dart patterns for cross-platform mobile apps including feature-first project structure, const widget best practices, and Riverpod/Bloc state management.
Guides Flutter cross-platform app development: widget patterns, Riverpod/Bloc state management, GoRouter navigation, const/performance optimization, responsive layouts, testing, DevTools.
Provides Flutter/Dart guidance on architecture (BLoC, Riverpod), state management, widgets, navigation (GoRouter), data (Dio, Hive), performance, and testing for cross-platform mobile apps.
Share bugs, ideas, or general feedback.
| Agent | 说明 |
|---|---|
| dev | Flutter 开发专家 |
| debug | Flutter 调试专家 |
| test | Flutter 测试专家 |
| perf | Flutter 性能优化专家 |
| 场景 | Skill | 说明 |
|---|---|---|
| 状态管理 | Skills(flutter:state) | Riverpod 2.x、Bloc 8.x |
| UI 开发 | Skills(flutter:ui) | Material 3、Cupertino、响应式布局 |
| Android | Skills(flutter:android) | Material 3 Expressive、Impeller |
| iOS | Skills(flutter:ios) | Cupertino、Impeller、App Store |
| Web | Skills(flutter:web) | WASM 编译、CanvasKit、PWA |
Flutter 开发追求Dart 3 类型安全、平台自适应 UI、可测试的 Clean Architecture。
Navigator.push 命令式路由(使用 go_router 声明式路由)// 1. Records - 替代临时类
(String name, int age) getUserInfo() => ('Alice', 30);
final (name, age) = getUserInfo();
// 2. Patterns - switch expression
String describe(Object obj) => switch (obj) {
int n when n > 0 => 'positive',
int n when n < 0 => 'negative',
int() => 'zero',
String s => 'string: $s',
_ => 'unknown',
};
// 3. Sealed classes - 有限状态建模
sealed class Result<T> {
const Result();
}
final class Success<T> extends Result<T> {
const Success(this.data);
final T data;
}
final class Failure<T> extends Result<T> {
const Failure(this.error);
final Object error;
}
// 4. Class modifiers
final class AppConfig {} // 不可继承
interface class Serializable {} // 只能实现
base class BaseRepository {} // 只能继承
// 5. Extension types - 零成本抽象
extension type UserId(String value) implements String {}
extension type Email(String value) implements String {
bool get isValid => value.contains('@');
}
// 类型:PascalCase
class UserProfileCard extends StatelessWidget {}
sealed class AuthState {}
extension type UserId(String value) {}
// 变量/函数:camelCase
final userName = 'John';
void buildHeader() {}
// 常量:camelCase(Dart 官方风格)
const defaultPadding = 16.0;
const maxRetries = 3;
// 私有:下划线前缀
class _InternalWidget extends StatelessWidget {}
void _buildContent() {}
// 文件名:snake_case
// user_profile_card.dart
// auth_controller.dart
// home_page.dart
// Provider:camelCase + Provider 后缀
final userProvider = ...;
final authControllerProvider = ...;
lib/
core/ # 基础设施
theme/app_theme.dart
router/app_router.dart
constants/
extensions/
utils/
features/ # 功能模块(按功能划分)
auth/
data/ # Repository 实现、DataSource、DTO
domain/ # Entity、UseCase、Repository 接口
presentation/ # Widget、Controller/ViewModel
home/
profile/
shared/ # 共享资源
widgets/ # 通用 Widget
models/ # 共享数据模型
test/
features/ # 镜像 lib/features 结构
shared/
integration_test/ # 端到端测试
| AI 可能的理性化解释 | 实际应该检查的内容 | 严重程度 |
|---|---|---|
| "if-else 就够了" | 是否使用 sealed class + switch expression? | 中 |
| "class 就行了" | 是否使用 Records 替代临时数据结构? | 低 |
| "Provider 够用了" | Provider 已停止维护,是否使用 Riverpod? | 高 |
| "GetX 开发快" | GetX 是技术债务,是否使用 Riverpod/Bloc? | 高 |
| "不需要 class modifier" | 是否使用 final/sealed/base 限制继承? | 中 |
| "直接写颜色值" | 是否从 Theme/ColorScheme 获取颜色? | 高 |
| "Navigator.push 更直接" | 是否使用 go_router 声明式路由? | 中 |