dart-add-unit-test
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing…
Adds interactive widget previews to the project using the previews.dart system. Use when creating new UI components or updating existing screens to ensure consistent design and interactive testing.
Claude Code
$ npx -y skills add flutter/agent-plugins --skill flutter-add-widget-preview --agent claude-code
Codex
$ npx skills add flutter/agent-plugins --skill flutter-add-widget-preview -a codex -y
Cursor
$ npx skills add flutter/agent-plugins --skill flutter-add-widget-preview -a cursor -y
Gemini CLI
$ npx skills add flutter/agent-plugins --skill flutter-add-widget-preview -a gemini-cli -y
GitHub Copilot
$ npx skills add flutter/agent-plugins --skill flutter-add-widget-preview -a github-copilot -y
OpenCode
$ npx skills add flutter/agent-plugins --skill flutter-add-widget-preview -a opencode -y
Windsurf
$ npx skills add flutter/agent-plugins --skill flutter-add-widget-preview -a windsurf -y
name: flutter-add-widget-preview description: Adds interactive widget previews to the project using the previews.dart system. Use when creating new UI components or updating existing screens to ensure consistent design and interactive testing. metadata: model: models/gemini-3.1-pro-preview last_modified: Tue, 21 Apr 2026 20:05:23 GMT
Use the Flutter Widget Previewer to render widgets in real-time, isolated from the full application context.
The `@Preview` annotation supports the following parameters for tailoring preview environments:
Adhere to the following constraints when authoring previewable widgets, as the Widget Previewer runs in a web environment:
Copy and track this checklist when implementing a new widget preview:
Follow the appropriate conditional workflow to launch and interact with the Widget Previewer:
**If using a supported IDE (Android Studio, IntelliJ, VS Code with Flutter 3.47+):** 1. Launch the IDE. The Widget Previewer starts automatically. 2. Open the "Flutter Widget Preview" tab in the sidebar. 3. Toggle "Filter previews by selected file" at the bottom left if you want to view previews outside the currently active file.
**If using the Command Line:** 1. Navigate to the Flutter project's root directory. 2. Run `flutter widget-preview start`. 3. View the automatically opened Chrome environment.
**Feedback Loop: Preview Iteration** 1. Modify the widget code or preview configuration. 2. Observe the automatic update in the Widget Previewer. 3. If global state (e.g., static initializers) was modified: Click the global hot restart button at the bottom right. 4. If only the local widget state needs resetting: Click the individual hot restart button on the specific preview card. 5. Review errors in the IDE/CLI console -> fix -> repeat.
import 'package:flutter/widget_previews.dart';
import 'package:flutter/material.dart';
@Preview(name: 'Submit Button', group: 'Form Controls')
Widget submitButtonPreview() => const ElevatedButton(
onPressed: null,
child: Text('Submit'),
);import 'package:flutter/widget_previews.dart';
import 'package:flutter/material.dart';
final class ThemedPreview extends Preview {
const ThemedPreview({
super.name,
super.group,
super.brightness,
});
PreviewThemeData _themeBuilder() =>
CustomThemeData(brightness: brightness);
@override
Preview transform() {
final originalPreview = super.transform();
final themeVariAgent plugins for Flutter, maintained by the Flutter team. A collection of plugins designed to extend AI agent capabilities for Flutter development.
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing…
Architectural patterns, entrypoint structure, exit codes, stream routing, and subprocess spawning for Dart command-line interface…
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…
Define and generate mock objects for external dependencies using `package:mockito` and `build_runner`. Use when unit testing…
Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.