dart-use-pattern-matching 是做什么的?
在适当的地方使用 switch 表达式和模式匹配
在适当的地方使用 switch 表达式和模式匹配
该技能指导开发者在 Dart 代码中有效利用 switch 表达式和模式匹配功能,以提升代码的可读性和表达力。它提倡在条件判断、解构和类型检查等场景中使用现代 Dart 语法,替代传统的 if-else 链或冗长的类型转换。此技能适用于所有 Dart 开发环境,包括 Flutter 项目、命令行工具和服务器端应用。通过遵循该技能,代码将更加简洁、安全,并充分利用 Dart 3.0 引入的模式匹配特性。
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.