dart-rules

Solid

Dart/Flutter coding rules: style, patterns, security, testing. Triggers: .dart, pubspec.yaml, Flutter, Riverpod, Bloc, widget, StatelessWidget, StatefulWidget.

AI & Automation 155 stars 19 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
73
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Dart/Flutter Rules These rules come from `app/rules/dart/` in ai-toolkit. They cover the project's standards for coding style, frameworks, patterns, security, and testing in Dart/Flutter. Apply them when writing or reviewing Dart/Flutter code. # Dart Coding Style ## Naming - PascalCase: classes, enums, typedefs, extensions, mixins. - camelCase: variables, functions, methods, parameters, named constants. - snake_case: libraries, packages, directories, source files. - UPPER_SNAKE: not used in Dart. Use camelCase for constants. - Prefix private members with `_`: `_internalState`, `_helper()`. ## Null Safety - Enable sound null safety (default since Dart 2.12). - Use `?` types only when null is semantically meaningful. - Use `!` operator sparingly. Prefer null checks or `??` fallback. - Use `late` keyword only when initialization is guaranteed before access. - Use `required` keyword for mandatory named parameters. ## Classes - Use `const` constructors for immutable classes. - Use factory constructors for caching, subtype selection, or validation. - Use named constructors for clarity: `Point.fromJson(json)`. - Use `final` fields for immutable properties. - Use `@immutable` annotation on classes that should be immutable. ## Functions - Use named parameters for functions with >2 parameters. - Use `required` for mandatory named parameters. - Use default values for optional parameters. - Use fat arrow (`=>`) for single-expression functions. - Always specify return types for pu...

Details

Author
softspark
Repository
softspark/ai-toolkit
Created
2 months ago
Last Updated
2 days ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category