mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-03 23:53:29 +08:00
1.3 KiB
1.3 KiB
paths
| paths | |||
|---|---|---|---|
|
Dart/Flutter Hooks
This file extends common/hooks.md with Dart and Flutter-specific content.
PostToolUse Hooks
Configure in ~/.claude/settings.json:
- dart format: Auto-format
.dartfiles after edit - dart analyze: Run static analysis after editing Dart files and surface warnings
- flutter test: Optionally run affected tests after significant changes
Recommended Hook Configuration
{
"hooks": {
"PostToolUse": [
{
"matcher": { "tool_name": "Edit", "file_paths": ["**/*.dart"] },
"hooks": [
{ "type": "command", "command": "dart format $CLAUDE_FILE_PATHS" }
]
}
]
}
}
Pre-commit Checks
Run before committing Dart/Flutter changes:
dart format --set-exit-if-changed .
dart analyze --fatal-infos
flutter test
Useful One-liners
# Format all Dart files
dart format .
# Analyze and report issues
dart analyze
# Run all tests with coverage
flutter test --coverage
# Regenerate code-gen files
dart run build_runner build --delete-conflicting-outputs
# Check for outdated packages
flutter pub outdated
# Upgrade packages within constraints
flutter pub upgrade