LLM Skills
~/catalogue/debugging et maintenance//flutter-build

Compilation et correction dans flutter

/flutter-build

Diagnostique et corrige les erreurs de compilation, dépendances et configuration Flutter.

affaan-maffaan-m
240.5k
24 mai 2026
MIT License
// contenu du skill

description: Fix Dart analyzer errors and Flutter build failures incrementally. Invokes the dart-build-resolver agent for minimal, surgical fixes.


Flutter Build and Fix

This command invokes the dart-build-resolver agent to incrementally fix Dart/Flutter build errors with minimal changes.

What This Command Does

  1. Run Diagnostics: Execute flutter analyze, flutter pub get
  2. Parse Errors: Group by file and sort by severity
  3. Fix Incrementally: One error at a time
  4. Verify Each Fix: Re-run analysis after each change
  5. Report Summary: Show what was fixed and what remains

When to Use

Use /flutter-build when:

  • flutter analyze reports errors
  • flutter build fails for any platform
  • dart pub get / flutter pub get fails with version conflicts
  • build_runner fails to generate code
  • After pulling changes that break the build

Diagnostic Commands Run

bash
# Analysis
flutter analyze 2>&1

# Dependencies
flutter pub get 2>&1

# Code generation (if project uses build_runner)
dart run build_runner build --delete-conflicting-outputs 2>&1

# Platform builds
flutter build apk 2>&1
flutter build web 2>&1

Example Session

`text
User: /flutter-build

Agent:
# Flutter Build Resolution

## Initial Diagnostics

$ flutter analyze

Analyzing project...

error • lib/features/user/data/userrepositoryimpl.dart:34:16 •

A value of type 'String?' can't be assigned to a variable of type 'String'. •

invalid_assignment

error • lib/features/cart/presentation/cart_page.dart:58:5 •

The method 'add' isn't defined for the type 'List<Item>'.

Try correcting the name to the name of an existing method, or defining a method named 'add'. •

undefined_method

2 errors found.


## Fix 1: Null Safety

File: lib/features/user/data/user_repository_impl.dart:34
Error: A value of type 'String?' can't be assigned to type 'String'

Changed:

final id = response.id;

To:

final id = response.id ?? '';

$ flutter analyze

1 error found.


## Fix 2: Immutable List

File: lib/features/cart/presentation/cart_page.dart:58
Error: The method 'add' isn't defined for the type 'List<Item>'
Cause: State holds an unmodifiable list; mutation goes through Cubit

Changed:

state.items.add(item);

To:

context.read<CartCubit>().addItem(item);

// Note: Cubit exposes named methods (addItem, removeItem);

// .add(event) is the BLoC event API — don't mix them.

$ flutter analyze

No issues found!


## Final Verification

$ flutter test

All tests passed.


## Summary

| Metric | Count |
|--------|-------|
| Analysis errors fixed | 2 |
| Files modified | 2 |
| Remaining issues | 0 |

Build Status: PASS ✓

Common Errors Fixed

ErrorTypical Fix
A value of type 'X?' can't be assigned to 'X'Add ?? default or null guard
The name 'X' isn't definedAdd import or fix typo
Non-nullable instance field must be initializedAdd initializer or late
Version solving failedAdjust version constraints in pubspec.yaml
Missing concrete implementation of 'X'Implement missing interface method
build_runner: Part of X expectedDelete stale .g.dart and rebuild

Fix Strategy

  1. Analysis errors first — code must be error-free
  2. Warning triage second — fix warnings that could cause runtime bugs
  3. pub conflicts third — fix dependency resolution
  4. One fix at a time — verify each change
  5. Minimal changes — don't refactor, just fix

Stop Conditions

The agent will stop and report if:

  • Same error persists after 3 attempts
  • Fix introduces more errors
  • Requires architectural changes
  • Package upgrade conflicts need user decision

Related Commands

  • /flutter-test — Run tests after build succeeds
  • /flutter-review — Review code quality
  • verification-loop skill — Full verification loop

Related

  • Agent: agents/dart-build-resolver.md
  • Skill: skills/flutter-dart-code-review/
// source originale publique
affaan-m/ECC
/commands/flutter-build.md
Licence : MIT License
Projet indépendant, non affilié à Anthropic. Ce skill reste la propriété de son auteur original.
// installer ce skill
Collez cette commande dans votre terminal à la racine de votre projet :
mkdir -p .claude/commands && curl -o ".claude/commands/flutter-build.md" "https://raw.githubusercontent.com/affaan-m/ECC/main/commands/flutter-build.md"
Ensuite dans Claude Code, tapez /flutter-build pour l'activer.
open_in_newVoir la source originale
// sauvegarder
Sauvegarde disponible après connexion.
loginSe connecter pour sauvegarder
// informations
Créateuraffaan-m
Étoiles 240.5k
LicenceMIT License
Mis à jour24 mai 2026
Format.md
AccèsGratuit
// similaires

Skills Debugging et maintenance

Voir toutarrow_forward