Refactor Dart with patterns that fit the data.
Guides Dart refactoring with pattern matching to validate structured data, unpack values, and handle sealed types exhaustively.
When to use it
Use when refactoring complex if-else chains, parsing polymorphic data, destructuring collections or records, or enforcing sealed-class exhaustiveness; avoid simple conditions, single-variable type promotion, and basic collection filtering.
It changes how the agent writes and refactors Dart code, favoring pattern matching where it simplifies the code and ordinary conditionals where it does not.
What you provide
Uses Dart 3 pattern-matching features.
No additional actions listed.