Agent skill

Flutter Add Widget Preview

by abdulmominsakib in abdulmominsakib/localmind

Adds interactive widget previews to the project using the previews.dart system.

MITAuto-check passedMobile

Install Flutter Add Widget Preview

skills CLI
$ npx skills add abdulmominsakib/localmind --skill flutter-add-widget-preview -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install abdulmominsakib/localmind flutter-add-widget-preview --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/abdulmominsakib/localmind.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/flutter-add-widget-preview .claude/skills/flutter-add-widget-preview && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
flutter-add-widget-preview
GitHub stars
268
Used in
1 other repo
Token cost
~1.6k tokens
SKILL.md length
504 words
Files
1
Skills in repo
13
Repo updated
First seen
Licence
MIT

At a glance

Adds interactive widget previews to the project using the previews.dart system.

  • Works in 3 steps: Launch the IDE. The Widget Previewer… → Open the "Flutter Widget Preview" tab in… → Toggle "Filter previews by selected…
  • Creating new UI components
  • SKILL.md covers Contents, Preview Guidelines, Handling Limitations and Workflows, plus 1 more section
  • Calls flutter

What it does

Flutter Add Widget Preview is an agent skill from abdulmominsakib/localmind. 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.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile, covering Cross-platform mobile apps. It works with Flutter. The repository describes itself as: A mobile application designed to provide a beautiful, fast, and privacy-respecting interface for on device LLM and local LLM servers and cloud providers. The licence is MIT.

When your agent uses it

  • Creating new UI components
  • Updating existing screens to ensure consistent design and interactive testing

Example prompts

  • “/flutter-add-widget-preview”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  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.

What it can do on your machine

Read from SKILL.md and the folder at commit 9ff3f94. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • flutter

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Flutter Add Widget Preview loads about 1.6k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 504 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from abdulmominsakib/localmind at commit 9ff3f94, republished under its MIT licence (© abdulmominsakib). 504 words, ~1,562 tokens.

Download SKILL.mdSave it as .claude/skills/flutter-add-widget-preview/SKILL.md (or your agent's skills folder).
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
metadata.last_modified
Tue, 21 Apr 2026 20:05:23 GMT

Previewing Flutter Widgets

Contents

Preview Guidelines

Use the Flutter Widget Previewer to render widgets in real-time, isolated from the full application context.

  • Target Elements: Apply the @Preview annotation to top-level functions, static methods within a class, or public widget constructors/factories that have no required arguments and return a Widget or WidgetBuilder.
  • Imports: Always import package:flutter/widget_previews.dart to access the preview annotations.
  • Custom Annotations: Extend the Preview class to create custom annotations that inject common properties (e.g., themes, wrappers) across multiple widgets.
  • Multiple Configurations: Apply multiple @Preview annotations to a single target to generate multiple preview instances. Alternatively, extend MultiPreview to encapsulate common multi-preview configurations.
  • Runtime Transformations: Override the transform() method in custom Preview or MultiPreview classes to modify preview configurations dynamically at runtime (e.g., generating names based on dynamic values, which is impossible in a const context).

Handling Limitations

Adhere to the following constraints when authoring previewable widgets, as the Widget Previewer runs in a web environment:

  • No Native APIs: Do not use native plugins or APIs from dart:io or dart:ffi. Widgets with transitive dependencies on dart:io or dart:ffi will throw exceptions upon invocation. Use conditional imports to mock or bypass these in preview mode.
  • Asset Paths: Use package-based paths for assets loaded via dart:ui fromAsset APIs (e.g., packages/my_package_name/assets/my_image.png instead of assets/my_image.png).
  • Public Callbacks: Ensure all callback arguments provided to preview annotations are public and constant to satisfy code generation requirements.
  • Constraints: Apply explicit constraints using the size parameter in the @Preview annotation if your widget is unconstrained, as the previewer defaults to constraining them to approximately half the viewport.

Workflows

Creating a Widget Preview

Copy and track this checklist when implementing a new widget preview:

  • Import package:flutter/widget_previews.dart.
  • Identify a valid target (top-level function, static method, or parameter-less public constructor).
  • Apply the @Preview annotation to the target.
  • Configure preview parameters (name, group, size, theme, brightness, etc.) as needed.
  • If applying the same configuration to multiple widgets, extract the configuration into a custom class extending Preview.
Show full SKILL.md (174 more words)Show less
Interacting with Previews

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.38+):

  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.

Examples

Basic Preview
dart
import 'package:flutter/widget_previews.dart';
import 'package:flutter/material.dart';

@Preview(name: 'My Sample Text', group: 'Typography')
Widget mySampleText() {
  return const Text('Hello, World!');
}
Custom Preview with Runtime Transformation
dart
import 'package:flutter/widget_previews.dart';
import 'package:flutter/material.dart';

final class TransformativePreview extends Preview {
  const TransformativePreview({
    super.name,
    super.group,
  });

  PreviewThemeData _themeBuilder() {
    return PreviewThemeData(
      materialLight: ThemeData.light(),
      materialDark: ThemeData.dark(),
    );
  }

  @override
  Preview transform() {
    final originalPreview = super.transform();
    final builder = originalPreview.toBuilder();
    
    builder
      ..name = 'Transformed - ${originalPreview.name}'
      ..theme = _themeBuilder;

    return builder.toPreview();
  }
}

@TransformativePreview(name: 'Custom Themed Button')
Widget myButton() => const ElevatedButton(onPressed: null, child: Text('Click'));
MultiPreview Implementation
dart
import 'package:flutter/widget_previews.dart';
import 'package:flutter/material.dart';

/// Creates light and dark mode previews automatically.
final class MultiBrightnessPreview extends MultiPreview {
  const MultiBrightnessPreview({required this.name});

  final String name;

  @override
  List<Preview> get previews => const [
        Preview(brightness: Brightness.light),
        Preview(brightness: Brightness.dark),
      ];

  @override
  List<Preview> transform() {
    final previews = super.transform();
    return previews.map((preview) {
      final builder = preview.toBuilder()
        ..group = 'Brightness'
        ..name = '$name - ${preview.brightness!.name}';
      return builder.toPreview();
    }).toList();
  }
}

@MultiBrightnessPreview(name: 'Primary Card')
Widget cardPreview() => const Card(child: Padding(padding: EdgeInsets.all(8.0), child: Text('Content')));

© abdulmominsakib, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/flutter-add-widget-preview of abdulmominsakib/localmind.

Open the folder on GitHubat commit 9ff3f94

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in abdulmominsakib/localmind, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Flutter Add Widget Preview next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Flutter Add Widget Preview compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Flutter Add Widget Preview this skillabdulmominsakib/localmind2681 repos~1.6kAutomated safety check: PassMIT
Add Flutter Docusaurus Localematthiasn/lotti1.2k—~1.2kAutomated safety check: PassGPL-3.0
Tm Launcher DesignFar-Se/tabame372—~3.1kAutomated safety check: PassMIT
Flutter Initbear2u/my-skills932—~2.5kAutomated safety check: PassNone
Mobile App UI Designceorkm/mobile-app-ui-design409—~2kAutomated safety check: PassNone
Marionette Flutter Drive Appleancodepl/marionette_mcp482—~11kAutomated safety check: PassApache-2.0

Similar skills

  • Add, complete, or audit a locale across a Flutter application's ARB catalogs and a localized Docusaurus manual, including generated localization code, locale selectors, native platform declarations…

    1.2k GitHub stars~1.2k tokensUpdated today
    MobileAuto-check passed
  • Tm Launcher Design

    Far-Se/tabame

    Create or revise Tabame's Flutter launcher designs: frames, search bars, result rows, palettes, typography, and action dialogs.

    372 GitHub stars~3.1k tokensUpdated yesterday
    MobileAuto-check passed
  • Flutter Init

    bear2u/my-skills

    A skill your agent uses when user wants to create a new Flutter project (Todo/Habit/Note/Expense/Custom domain) with Clean Architecture, Riverpod 3.0, Drift, and modern Flutter stack

    932 GitHub stars~2.5k tokensUpdated 3 mo ago
    MobileAuto-check passed
  • Mobile App UI Design

    ceorkm/mobile-app-ui-design

    Design high-quality mobile app UI/UX screens, flows, and components.

    409 GitHub stars~2k tokensUpdated 3 mo ago
    MobileAuto-check passed
  • Marionette Flutter Drive App

    leancodepl/marionette_mcp

    Set up and drive a running Flutter app (debug or profile) with Marionette — an AI agent's hands and eyes for the app.

    482 GitHub stars~11k tokensUpdated 5 days ago
    MobileAuto-check passed
  • Flutter Screenshot

    JustLookAtNow/pt_mate

    Capture and show two Flutter UI screenshots for this project: one landscape/large-screen preview and one portrait/mobile preview, without using Flutter Web.

    504 GitHub stars~511 tokensUpdated yesterday
    MobileAuto-check passed

More from abdulmominsakib/localmind

All 13 skills in this repo
  • Flutter Feature Based Architecture

    abdulmominsakib/localmind

    Design, implement, refactor, and review Flutter apps that use feature-based vertical slices, handwritten Dart models/providers, componentized StatelessWidget UI, Riverpod state management, and a…

    268 GitHub stars~2.9k tokensUpdated 2 days ago
    Auto-check passed
  • Flutter Add Widget Test

    abdulmominsakib/localmind

    Implement a component-level test using WidgetTester to verify UI rendering and user interactions (tapping, scrolling, entering text).

    268 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed
  • Architects a Flutter application using the recommended layered approach (UI, Logic, Data).

    268 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed
  • Flutter Build Responsive Layout

    abdulmominsakib/localmind

    Use LayoutBuilder, MediaQuery, or Expanded/Flexible to create a layout that adapts to different screen sizes.

    268 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Flutter Fix Layout Issues

    abdulmominsakib/localmind

    Fixes Flutter layout errors (overflows, unbounded constraints) using Dart and Flutter MCP tools.

    268 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Flutter Implement JSON Serialization

    abdulmominsakib/localmind

    Create model classes with fromJson and toJson methods using dart:convert.

    268 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed

Works with

Categories

Questions about Flutter Add Widget Preview

What does Flutter Add Widget Preview do?

Adds interactive widget previews to the project using the previews.dart system. Flutter Add Widget Preview is an agent skill from abdulmominsakib/localmind.dart system.

When should I use Flutter Add Widget Preview?

Flutter Add Widget Preview fits situations like: creating new UI components; updating existing screens to ensure consistent design and interactive testing.

How do I install Flutter Add Widget Preview in Claude Code?

Run `npx skills add abdulmominsakib/localmind --skill flutter-add-widget-preview -a claude-code`. Or copy the skill folder (.agents/skills/flutter-add-widget-preview in abdulmominsakib/localmind) into .claude/skills/flutter-add-widget-preview in your project. Claude Code loads it when a task matches its description.

How do I install Flutter Add Widget Preview in Codex?

Run `npx skills add abdulmominsakib/localmind --skill flutter-add-widget-preview -a codex`. Or copy the skill folder (.agents/skills/flutter-add-widget-preview in abdulmominsakib/localmind) into .agents/skills/flutter-add-widget-preview in your project. Codex loads it when a task matches its description.

Can I use Flutter Add Widget Preview in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add abdulmominsakib/localmind --skill flutter-add-widget-preview -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/flutter-add-widget-preview, .gemini/skills/flutter-add-widget-preview, .github/skills/flutter-add-widget-preview and .opencode/skills/flutter-add-widget-preview in your project.

What does Flutter Add Widget Preview need to run?

Going by SKILL.md and its folder, Flutter Add Widget Preview needs the command-line tools its instructions call (flutter).

Does Flutter Add Widget Preview access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Flutter Add Widget Preview safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Flutter Add Widget Preview use?

Flutter Add Widget Preview is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Flutter Add Widget Preview use?

About 1.6k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Flutter Add Widget Preview?

Skills that share tags, products or a category with Flutter Add Widget Preview: Add Flutter Docusaurus Locale (matthiasn/lotti, 1.2k stars), Tm Launcher Design (Far-Se/tabame, 372 stars), Flutter Init (bear2u/my-skills, 932 stars) and Mobile App UI Design (ceorkm/mobile-app-ui-design, 409 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Flutter Add Widget Preview?

abdulmominsakib (a GitHub user) maintains it in abdulmominsakib/localmind, which has 268 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on October 8, 2026.

Source: abdulmominsakib/localmind on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.