dart-best-practices by kevmoo/dash_skills
npx skills add https://github.com/kevmoo/dash_skills --skill dart-best-practices在以下情况下使用此技能:
对于大段文本(如 SQL 查询、HTML 或 PEM 编码的密钥),优先使用多行字符串 (''') 而不是用 + 和 \n 拼接字符串。这可以提高可读性,并通过允许自然的换行来避免 lines_longer_than_80_chars 的 lint 错误。
避免:
final pem = '-----BEGIN RSA PRIVATE KEY-----\n' +
base64Encode(fullBytes) +
'\n-----END RSA PRIVATE KEY-----';
推荐:
final pem = '''
-----BEGIN RSA PRIVATE KEY-----
${base64Encode(fullBytes)}
-----END RSA PRIVATE KEY-----''';
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
避免行长度超过 80 个字符,即使在 Markdown 文件和注释中也是如此。这确保了代码在分屏视图和较小屏幕上无需水平滚动即可阅读。
推荐: 将文本换行的目标设为 80 个字符。对于无法断行的长 URL 或标识符,允许例外。
dart-modern-features : 用于现代 Dart 功能的地道用法,例如模式匹配(对深度 JSON 提取很有用)、记录和 Switch 表达式。每周安装量
173
代码仓库
GitHub 星标数
119
首次出现
2026年2月12日
安全审计
安装于
codex112
antigravity79
opencode72
github-copilot72
gemini-cli71
cursor71
Use this skill when:
Prefer using multi-line strings (''') over concatenating strings with + and \n, especially for large blocks of text like SQL queries, HTML, or PEM-encoded keys. This improves readability and avoids lines_longer_than_80_chars lint errors by allowing natural line breaks.
Avoid:
final pem = '-----BEGIN RSA PRIVATE KEY-----\n' +
base64Encode(fullBytes) +
'\n-----END RSA PRIVATE KEY-----';
Prefer:
final pem = '''
-----BEGIN RSA PRIVATE KEY-----
${base64Encode(fullBytes)}
-----END RSA PRIVATE KEY-----''';
Avoid lines longer than 80 characters, even in Markdown files and comments. This ensures code is readable in split-screen views and on smaller screens without horizontal scrolling.
Prefer: Target 80 characters for wrapping text. Exceptions are allowed for long URLs or identifiers that cannot be broken.
dart-modern-features : For idiomatic usage of modern Dart features like Pattern Matching (useful for deep JSON extraction), Records, and Switch Expressions.Weekly Installs
173
Repository
GitHub Stars
119
First Seen
Feb 12, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex112
antigravity79
opencode72
github-copilot72
gemini-cli71
cursor71
Flutter 主屏幕小组件开发指南:iOS/Android 原生小组件集成与数据通信
3,500 周安装