Flutter UI Widgets

Enforce Flutter UI component best practices for state management, composition, theming, and layout.

Updated Jan 22, 2026
One-click install
npx skills add https://github.com/ngxtm/skill-rule --skill flutter-ui-widgets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Flutter UI Widgets
Source: https://github.com/ngxtm/skill-rule/tree/main/rules/flutter/widgets
Command: npx skills add https://github.com/ngxtm/skill-rule --skill flutter-ui-widgets

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidelines and best practices for creating maintainable and scalable UI components in Flutter applications.

Core Features & Use Cases

  • Component Composition: Encourages breaking down UI into small, reusable const widgets.
  • State Management: Recommends StatelessWidget by default, using StatefulWidget only for local state.
  • Theming: Enforces the use of Theme.of(context) for consistent styling.
  • Layout Optimization: Guides on using Flex and Gap/SizedBox for efficient layouts.
  • Specialized Widgets: Highlights appropriate use of widgets like SelectionArea, InteractiveViewer, and ListView.builder.

Quick Start

Apply the Flutter UI Widgets skill to refactor the provided AppButton widget for better composition and theming.

Frequently Asked Questions about Flutter UI Widgets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to build maintainable Flutter UI components?

To build maintainable Flutter UI components, break down layouts into small, reusable const widgets and default to StatelessWidget for efficient composition and rendering.

How do I manage state in Flutter for scalable user interfaces?

For scalable Flutter user interfaces, use StatelessWidget by default and only apply StatefulWidget for managing local state, ensuring efficient widget lifecycle and composition patterns.

How do I enforce consistent theming across Flutter widgets?

Enforce consistent theming across Flutter widgets by utilizing Theme.of(context) for styling, ensuring uniform design tokens throughout the application's UI component composition.

What is the best way to optimize Flutter layouts using Flex and Gap?

Optimize Flutter layouts by utilizing Flex properties alongside Gap or SizedBox for spacing, ensuring efficient rendering and maintainable structural composition within your user interfaces.

When should I use specialized Flutter widgets like ListView.builder and InteractiveViewer?

Use specialized Flutter widgets like ListView.builder, SelectionArea, and InteractiveViewer when handling dynamic lists, text selection, or pan/zoom interactions to ensure scalable UI performance.

Do I need to understand the Flutter widget lifecycle to use composition best practices?

Yes, applying Flutter UI composition best practices requires an existing understanding of the Flutter widget lifecycle and composition patterns to correctly refactor widgets for state management and theming.