elmm-programing/opencode/dart-optimization

Claude Code and agent skill by elmm-programing/opencode

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Master Dart/Flutter performance optimization including efficient code patterns, data structure selection, and compilation benefits.

Install

npx vskill@latest install elmm-programing/opencode/dart-optimization

SKILL.md

The same SKILL.md was published earlier as elmm-programing/opencode/dart-optimization.

Optimization

Performance in Dart goes beyond UI rendering; it's about efficient execution and smart resource utilization.

Dart Performance Patterns

  • Standardize Types: Avoid dynamic. Use explicit types or Object?. Statically typed code allows the compiler to perform far better optimizations.
  • Efficient Collections:
  • Use Set for average O(1) containment checks.
  • Use List for ordered indexing.
  • Prefer Iterable methods (map, where) for readability, but use for loops in performance-critical hot paths.
  • Inlining: Small getters and trivial functions are often inlined by the VM/AOT, but keeping them simple ensures this optimization happens.

Compile-Time Optimizations

  • Final & Const: Declare variables as final whenever possible. Use const constructors for widgets and data models to enable compile-time allocation and reduce runtime garbage collection pressure.
  • Ternary vs If-Else: In Dart, they are generally equivalent, but prioritize readability. Use switch expressions (Dart 3+) for exhaustive and efficient pattern matching.

Hot Paths & Loops

  • Minimize Work in Loops: Extract calculations and object creations outside of loops.
  • Collection Literals: Use literal syntax [] or {} instead of constructors like List() for brevity and minor performance gains.

Profiling

  • DevTools CPU Profiler: Identify hot paths and "heavy" functions.
  • Benchmarking: Use package:benchmark_harness for scientific performance measurement of non-UI logic.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/elmm-programing/opencode/dart-optimization/badge)](https://verified-skill.com/skills/elmm-programing/opencode/dart-optimization)

Something wrong with this skill or its page? Tell us.