Skip to content

flutter-add-widget-preview

Adds interactive widget previews to the project using the previews.dart system. Use when creating new UI components or updating existing screens to ensure

— (0 ratings) 41K downloads flutter
$ npx skills add https://github.com/flutter/agent-plugins --skill flutter-add-widget-preview

Skills can run code on your computer. Review the source before installing. This listing is community-made and isn't affiliated with Anthropic.

About this skill

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., custom themes, wrappers, sizes) 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., building names dynamically based on parameters, which is impossible in a const constructor).

Preview Parameters


Installs: 41.0K | GitHub stars: 3.2K | First seen: Apr 24, 2026

Related skills

New

Design & UI

design-mobile-apps

Design mobile app screens with Sleek, edit Sleek projects, and implement their designs in React Native or HTML.

New • 1.7M
New

Design & UI

ios-designisn’t available in this repository.

ios-design — an installable skill for AI agents, published by uizze.sh/ios-design.

New • 421.1K
New

Frontend

imagegen-frontend-mobile

Premium mobile app screen concepts and flows with clean hierarchy, strong imagery, and distinctive art direction.

New • 373.8K