dart-use-pattern-matching 是做什麼的?
在適當的地方使用 switch 表達式和模式匹配
在適當的地方使用 switch 表達式和模式匹配
此技能指導 AI 代理(例如 Claude Code、Cursor 或 Codex)在處理 Dart 代碼時,識別並應用 switch 表達式和模式匹配。它專注於將傳統的 if-else 鏈或冗長類型檢查重構為更簡潔、表達力更強且符合 Dart 慣例的模式匹配結構。支援 Dart 3.0 以上版本引入的強大模式匹配功能,如記錄解構、守衛子句和 exhaustiveness checking。通過採用這些模式,開發者可以編寫出更不易出錯且更易維護的代碼,充分利用 Dart 語言的最新特性。
npx skills add https://github.com/dart-lang/skills/tree/main/skills/dart-use-pattern-matchingInstalled? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →
在適當的地方使用 switch 表達式和模式匹配
This repo contains 8 individual skills — each has its own dedicated page.
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains correct and regression-free.
Entrypoint structure, exit codes, cross-platform scripts. Use when building command line utilities, scripts, or applications.
Collect coverage using the coverage packge and create an LCOV report
Uses get_runtime_errors and lsp to fetch an active stack trace, locate the failing line, apply a fix, and verify resolution via hot_reload.
Define and generate mock objects for external dependencies using `package:mockito` and `build_runner`. Use when unit testing classes that depend on complex external services like APIs or databases.
Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.
Workflow for fixing package version conflicts. Use this when `pub get` fails due to incompatible package versions.
Execute `dart analyze` to identify warnings and errors, and use `dart fix --apply` to automatically resolve mechanical lint issues. Use during development to ensure code quality and before committing changes.
Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.
Control Eight Sleep pods (status, temperature, alarms, schedules).
BluOS CLI (blu) for discovery, playback, grouping, and volume.
Create, search, and manage Bear notes via grizzly CLI.
Capture frames or clips from RTSP/ONVIF cameras.
Search GIF providers with CLI/TUI, download results, and extract stills/sheets.