Claude-skill-registry flutter-std
Build and debug Flutter/Dart apps with Riverpod (codegen), Freezed, and GoRouter. Use when implementing Flutter features, running apps, hot reload/restart, or debugging UI.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/flutter-std" ~/.claude/skills/majiayu000-claude-skill-registry-flutter-std && rm -rf "$T"
manifest:
skills/data/flutter-std/SKILL.mdsource content
Flutter Std Tools
When to use
- Use when the user is working on Flutter/Dart features, running the app, hot reload/restart, or debugging UI.
- Use when requests mention Riverpod, Freezed, GoRouter, or Flutter widget structure.
Instructions
- Setup: Ensure the project root is added via
. List devices withdart___add_roots
before launching.dart___list_devices - Run & lifecycle: Use
to run on a device. Usedart___launch_app
for UI changes (preserves state) anddart___hot_reload
for logic/state resets. Avoiddart___hot_restart
via shell. Stop apps withflutter run
.dart___stop_app - Debug & inspect: Connect DTD with
when needed. Usedart___connect_dart_tooling_daemon
,dart___get_widget_tree
, anddart___get_runtime_errors
.dart___get_app_logs - Testing & maintenance: Run tests with
. Manage deps viadart___run_tests
. Analyze/fix withdart___pub
anddart___analyze_files
.dart___dart_fix - Code generation:
(one-time) ordart run build_runner build --delete-conflicting-outputs
(watch).dart run build_runner watch --delete-conflicting-outputs
Requirements
Architecture & tech stack
- State Management: Must use Riverpod with code generation (
).@riverpod - Data Models: Must use Freezed for immutable data classes and unions.
- Dependency Injection: Must use GetIt and Injectable for service location.
- Routing: Must use GoRouter for navigation (declarative routing).
- Database: Must use SQLite for structured data storage.
- Widget State Structure (Stateful/Stateless): Follow the Widget State Structure section below and split widget classes into UI, Actions, and Utils extensions.
Project Structure
- core/ - Core services and singletons
- config/ - App configuration
- di/ - Dependency injection setup (GetIt/Injectable)
- routing/ - GoRouter configuration
- utils/ - General utilities
- data/ - Data models and storage
- consts/ - Constant definitions
- models/ - Freezed data models
- providers/ - Riverpod providers (using code generation)
- repos/ - Data access layer
- services/ - External services (API, Database, etc.)
- views/ - UI components and pages
- pages/ - Main pages
- widgets/ - Reusable widgets
- pops/ - Popups and dialogs
- app.dart - App entry point widget
- main.dart - Main entry file
Additional guidelines
- Formatting: Do NOT run
. Follow the project's existing code style.dart format - Deprecations: Replace all
usage withColor.withOpacity
(Flutter 3.27+).Color.withValues - Testing:
classes require unit test coverage.utils
Widget State Structure (Stateful/Stateless)
To maintain clean and manageable code, split widget classes into three parts using
extensions within the same file. This applies to both StatefulWidget (State class) and StatelessWidget (the widget class), separating UI from logic and event handling.
Structure
- UI: The main
class containing theState
method and widget definitions.build() - Actions: An extension on the
class for event handlers (e.g.,State
,_onTap
)._submit - Utils: An extension on the
class for private helper methods and business logic.State
Example (StatefulWidget)
import 'package:flutter/material.dart'; class MyPage extends StatefulWidget { const MyPage({super.key}); @override State<MyPage> createState() => _MyPageState(); } // 1. UI - Main State Class class _MyPageState extends State<MyPage> { final _controller = TextEditingController(); @override void dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('My Page')), body: Padding( padding: const EdgeInsets.all(16.0), child: Column( children: [ TextField( controller: _controller, decoration: const InputDecoration(labelText: 'Enter text'), ), const SizedBox(height: 20), ElevatedButton( onPressed: _onSubmit, // Reference to Actions extension child: const Text('Submit'), ), ], ), ), ); } } // 2. Actions - Event Handlers extension _MyPageActions on _MyPageState { void _onSubmit() { final text = _controller.text; if (_validateInput(text)) { // Reference to Utils extension _showSuccessDialog(text); } else { _showErrorSnackBar(); } } void _showSuccessDialog(String text) { showDialog( context: context, builder: (_) => AlertDialog( title: const Text('Success'), content: Text('You entered: $text'), actions: [ TextButton( onPressed: () => Navigator.pop(context), child: const Text('OK'), ), ], ), ); } } // 3. Utils - Helper Methods & Logic extension _MyPageUtils on _MyPageState { bool _validateInput(String text) { return text.isNotEmpty && text.length > 3; } void _showErrorSnackBar() { ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('Input must be at least 4 characters')), ); } }
Example (StatelessWidget)
import 'package:flutter/material.dart'; class MyStatelessPage extends StatelessWidget { const MyStatelessPage({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('My Stateless Page')), body: Center( child: ElevatedButton( onPressed: () => _onSubmit(context), // Reference to Actions extension child: const Text('Submit'), ), ), ); } } // 2. Actions - Event Handlers extension _MyStatelessPageActions on MyStatelessPage { void _onSubmit(BuildContext context) { if (_validateInput('ok')) { // Reference to Utils extension _showSuccessDialog(context); } else { _showErrorSnackBar(context); } } void _showSuccessDialog(BuildContext context) { showDialog( context: context, builder: (_) => AlertDialog( title: const Text('Success'), content: const Text('Submitted.'), actions: [ TextButton( onPressed: () => Navigator.pop(context), child: const Text('OK'), ), ], ), ); } } // 3. Utils - Helper Methods & Logic extension _MyStatelessPageUtils on MyStatelessPage { bool _validateInput(String text) { return text.isNotEmpty; } void _showErrorSnackBar(BuildContext context) { ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('Invalid input')), ); } }
Example prompts
- "Run the flutter app on the iOS simulator"
- "Hot reload the app to show the new colors"
- "Create a new Riverpod provider for user authentication using code gen"
- "Implement a settings page using the project's existing preferences store"
- "Add a SQLite table for storing todo items"
- "Add a new route for the profile page using GoRouter"
- "Fix analysis errors in the project"
- "Generate a Freezed model for User with name and age fields"