moai-lang-flutter

Generate Flutter app templates with Dart 3.5, Riverpod, and go_router.

1.2k|214|Updated Sep 16, 2025
One-click install
npx skills add https://github.com/modu-ai/moai-adk --skill moai-lang-flutter
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: moai-lang-flutter
Source: https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/moai-lang-flutter
Command: npx skills add https://github.com/modu-ai/moai-adk --skill moai-lang-flutter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Flutter/Dart development with modern patterns (Dart 3.5, Records, Sealed Classes) and robust Flutter ecosystem (Riverpod, go_router) enabling scalable cross-platform apps.

Core Features & Use Cases

  • Dart 3.5 language features (patterns, records, sealed classes)
  • Riverpod state management with code generation
  • go_router declarative navigation
  • Platform channels for native iOS/Android integration
  • Testing patterns for robust apps

Quick Start

Create a small Flutter app that uses Riverpod for state and go_router for navigation.

Frequently Asked Questions about moai-lang-flutter

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

FAQPage Schema
How do I structure state management in a Flutter app using Riverpod?▼

Riverpod provides a reactive, compile-safe state management system using providers and notifiers. Define providers for immutable state and notifiers for mutable logic, then access them from widgets via `ref.watch()` or `ref.read()`. Code generation (`riverpod_generator`) eliminates boilerplate and enables type-safe state updates across your Flutter app.

Can I use Dart 3.5 pattern matching with sealed classes in Flutter development?▼

Yes. Dart 3.5 sealed classes enforce exhaustive pattern matching, and records let you destructure complex data cleanly. Use sealed classes to model domain types (e.g., network states: success, error, loading), then match on them in widgets for type-safe, maintainable UI logic without runtime errors.

What's the best way to implement navigation in a cross-platform Flutter app?▼

go_router provides declarative, URL-based navigation that scales across mobile, desktop, and web. Define routes as a tree, use named routes for clarity, and leverage deep linking automatically. Combine with Riverpod for state-driven navigation decisions that survive app restarts and platform transitions.

How do I integrate native iOS and Android code into a Flutter app?▼

Platform channels let Flutter communicate with native Objective-C/Swift (iOS) and Kotlin/Java (Android) code. Define a method channel in Dart, implement handlers on each native side, and invoke them from Flutter. This enables access to device-specific APIs, sensors, and libraries not available through Flutter packages.

Does Riverpod work with code generation, and do I need it?▼

Yes. `riverpod_generator` with `@riverpod` annotations generates providers automatically, catching errors at compile time and reducing manual boilerplate. It's optional but recommended for large apps; small projects can use manual providers without the generator setup.

What testing patterns ensure robust Flutter apps with Riverpod and go_router?▼

Use `ProviderContainer` to isolate and mock Riverpod providers in unit tests. For routing, mock `GoRouter` or test routes via `GoRouterState`. Widget tests combine both: inject a `ProviderScope` with test providers and verify navigation outcomes. This isolates logic from UI, speeding up tests.