coding-dart

Installation
SKILL.md

coding-dart

Purpose

This skill provides expertise in Dart 3 programming, focusing on features like null safety, async/await, streams, isolates, Flutter integration, and pub package management, to assist in writing efficient, safe code for apps and tools.

When to Use

Use this skill for Dart 3 projects involving mobile apps (e.g., Flutter), concurrent processing, asynchronous operations, or package dependencies. Apply it when null safety is critical to avoid runtime errors, or for handling real-time data with streams.

Key Capabilities

  • Null Safety: Enforce non-nullable types using late for lazy initialization and required for parameters, e.g., late String name; to declare a variable that must be initialized before use.
  • Async/Await: Handle asynchronous code with Future and async functions, such as Future<void> fetchData() async { var data = await http.get('/api/data'); }.
  • Streams: Manage asynchronous data streams using Stream from dart:async, e.g., Stream<int> countStream() async* { for (int i = 0; i < 5; i++) yield i; }.
  • Isolates: Run concurrent tasks with Isolate for CPU-bound operations, e.g., Isolate.spawn(workerFunction, args); to offload work.
  • Flutter Integration: Build UI with widgets and state management, e.g., using StatelessWidget for simple components.
  • Pub Package Manager: Manage dependencies via pub, including adding packages with pub add package_name.

Usage Patterns

To accomplish tasks, structure code with null safety by always specifying types (e.g., String? optionalString; for nullable values). For async operations, wrap I/O in async functions and use await for readability. Use isolates for background tasks to avoid UI blocking. Integrate Flutter by starting with MaterialApp in main.dart. For package management, run pub get after editing pubspec.yaml. Always test with dart test before deployment.

Related skills
Installs
26
GitHub Stars
5
First Seen
Mar 5, 2026