flutter-bug-investigation
Skill4 starsChanged 3 months agoMITView on GitHub
Use when investigating bugs, crashes, or unexpected behavior in a Flutter app. Especially when issues involve Bloc state not emitting, null safety errors, BuildContext after async, GetIt DI failures, method channel mismatches, widget rebuilds, or memory leaks.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-annotationsSkill
- android-accessibility-validatorSkill
- android-compose-architecture-reviewSkill
- android-kotlin-api-design-reviewerSkill
- android-performance-profilerSkill
- flutter-accessibility-validatorSkill
- flutter-code-reviewSkill
- flutter-design-architectureSkill
- flutter-feature-analysisSkill
- flutter-feature-implementationSkill
- flutter-performance-optimizerSkill
- ios-accessibility-validatorSkill
- ios-performance-profilerSkill
- ios-swift-api-design-reviewerSkill
- ios-swiftui-architecture-reviewSkill
- shared-bug-investigationSkill
- shared-perf-comparison-videoSkill
- shared-product-motion-videoSkill
- shared-task-workflowSkill
The file
Files
Bug Solving Skill (Flutter)
Foundation: Extends shared-bug-investigation with Flutter patterns.
Flutter Context
flutter --version && grep "sdk:" pubspec.yaml
grep -r "BlocProvider\|ChangeNotifier\|GetX" lib/ # State managementRCA: Check All Layers (data/domain/view)
# View Layer: Bloc/Cubit, widgets, state
find lib/feature/<feature>/view -name "*.dart"
# Domain Layer: Models, repository interfaces, business logic
find lib/feature/<feature>/domain -name "*.dart"
# Data Layer: DTOs, datasources, API calls
find lib/feature/<feature>/data -name "*.dart"Debug by layer: View (Bloc emits?) → Domain (model mapping?) → Data (DTO parsing?)
Common Bug Patterns
Bloc State
// ❌ Missing emit → ✅ Add emit(LoadingState()), emit(LoadedState(data)), emit(ErrorState())Null Safety
// ❌ user!.name → ✅ user?.name ?? 'Guest'BuildContext After Async
// ❌ Navigator.pop(context) after await → ✅ if (!mounted) return; Navigator.pop(context);GetIt DI
// ❌ Not registered → ✅ Add @injectable, run build_runnerMethod Channels
// ❌ Wrong name → ✅ Match iOS/Android channel nameWidget Rebuilds
// ❌ BlocBuilder wraps Scaffold → ✅ Wrap only bodyMemory Leaks
// ❌ Stream not closed → ✅ Override close(), call super.close()Error Quick Reference
| Error | Fix |
type 'Null' is not a subtype | Add ?? defaults |
Looking up deactivated widget | Check mounted |
Object not registered | Add @injectable, run build_runner |
MissingPluginException | Implement native iOS/Android |
setState() after dispose() | Cancel timers/streams |
RenderBox overflow | Fix constraints |
Tools
flutter analyze # Must pass (0 errors)
flutter test # All tests
flutter run --profile # PerformanceValidation
flutter analyze= 0 errorsflutter testpasses- Manual test fixed
- Tested iOS + Android (if platform-specific)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

