5,455,881 AI resources indexedWorking toward the world’s largest AI resource index.

PDF

Dart Best Practices (P1)

General purity standards for Dart development.

Installable skillMITBy ngxtmUpdated Nov 1, 2026
INTENDED FORClaude CodeCodexCursorGeminiInstall in a listed agent.

instructions.md

---
name: dart-best-practices-cbe7758a6e11
description: General purity standards for Dart development.
metadata:
  labels: [dart, clean-code]
  triggers:
    files: ['**/*.dart']
    keywords: [import, final, const, var, global]
---

# Dart Best Practices (P1)

- **Scoping**:
  - No global variables.
  - Private globals (if required) must start with `_`.
- **Immutability**: Use `const` > `final` > `var`.
- **Config**: Use `--dart-define` for secrets. Never hardcode API keys.
- **Naming**: Follow [effective-dart](https://dart.dev/guides/language/effective-dart) (PascalCase classes, camelCase members).

```dart
import 'models/user.dart'; // Good
import 'package:app/models/user.dart'; // Avoid local absolute
```

Discuss this resource

Platform guidance

Imported from the listed AgentSkill.sh category. Complete supplied package files and notices are retained. Required external tools and credentials are not installed. No bundled code was executed during import. Individual agent task behavior has not been tested.