Flutter Error Handling
Implement functional repository error recovery with Either/Failure patterns in Flutter. Use when handling exceptions or dartz Either types in data flows; defer UI-only retry buttons.
Unsigned, install at your own risk
UnverifiedThis skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install multi-language-standards-flutter-error-handlingManual setup by platform
Claude Code
~/.claude/skills/multi-language-standards-flutter-error-handling/SKILL.md
Instructions
Error Handling
Priority: P1 (HIGH)
Implementation Workflow
- Define failures — Create domain-specific failures using
@freezedunions (e.g.,UnauthorizedFailure,OutOfStockFailure). - Return Either — Repositories return
Either<Failure, T>. No exceptions in UI/BLoC. - Catch in Infrastructure only — Infrastructure catches exceptions (e.g.,
DioException) and returnsLeft(Failure). Never rethrow to UI. - Fold in BLoC — Use
.fold(failure, success)in BLoC to emit corresponding states. Remove try/catch from BLoC. - Localize messages — Use
failure.failureMessage(returnsTRObjector localized string) for UI-safe text. - Log with stable templates — Use low-cardinality message templates; pass variable data via metadata/context.
- No Silent Catch: Never swallow errors without logging or documented retry.
- Crashlytics Routing: All UI/BLoC
catchblocks MUST route errors viaAppLogger.error(AppException.fromException(e).message, error: e, stackTrace: st)for observability and type-safe UI messages.
Repository & BLoC Examples
See implementation examples for repository error mapping and BLoC consumption patterns.
Reference & Examples
For Failure definitions and API error mapping:
See references/REFERENCE.md.
Anti-Patterns
- No Try-Catch in BLoC: BLoC receives
Eitherandfolds; try/catch belongs in Infrastructure - No Plain String Failures: Define typed
@freezedFailure subclasses instead ofLeft('Something went wrong') - No Empty Catch Blocks: Always log and propagate; never swallow errors silently
- No Repositories Throwing Status: Return
Left(Failure)instead of throwingException - No Missing Log Registration: Use
AppLogger.errorin BLoC/UIcatchto ensure Crashlytics tracking and type-safe UI messages
Related Topics
layer-based-clean-architecture | bloc-state-management
Security
Reviews (0)
Related skills
Browse all →More from Multi-Language Standards
View source →More Build skills
Browse category →Frequently asked questions about flutter-error-handling
What does the flutter-error-handling skill do?
Implement functional repository error recovery with Either/Failure patterns in Flutter. Use when handling exceptions or dartz Either types in data flows; defer UI-only retry buttons. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the flutter-error-handling skill?
Run `npx @skills-hub-ai/cli install multi-language-standards-flutter-error-handling` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/multi-language-standards-flutter-error-handling/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does flutter-error-handling work with?
flutter-error-handling runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the flutter-error-handling skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use flutter-error-handling after installing it?
In Claude Code, type `/multi-language-standards-flutter-error-handling` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the flutter-error-handling skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.