utsavsavani08/rain-skill-main/flutter-expert

Claude Code and agent skill by utsavsavani08/rain-skill-main

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Flutter and Dart expert. Load for any Flutter app work — widget trees, state management (Riverpod, BLoC, Provider, GetX), navigation (GoRouter, AutoRoute), platform channels, Firebase integration, performance tuning, and app store submission. Complements mobile-design (touch/UX) which should also be loaded for Flutter projects. Triggers on flutter, dart, riverpod, bloc, gorouter, pubspec, flutter pub, flutter build, flutter run.

Install

npx vskill@latest install utsavsavani08/rain-skill-main/flutter-expert

SKILL.md

The same SKILL.md was published earlier as utsavsavani08/rain-skill-main/flutter-expert.

Flutter Expert — Dart & Flutter Development

Expert-level Flutter development covering architecture, state management, navigation, performance, platform integration, and release. Pairs with mobile-design for UX/touch concerns.

Philosophy

"Widget composition over inheritance. State at the right level. Platform feel without platform lock-in."

Flutter's power comes from its composable widget tree and Dart's strong typing. Abuse it and you get unmaintainable spaghetti. Use it well and you get apps that feel native on every platform.


Mandatory checkpoint (before any Flutter work)

🎯 FLUTTER CHECKPOINT:
Target: [ iOS / Android / Web / Desktop / All ]
State mgmt: [ Riverpod / BLoC / Provider / GetX / setState ]
Navigation: [ GoRouter / AutoRoute / Navigator 2.0 ]
Dart version: [ check pubspec.yaml ]
Files read: [ this SKILL.md + mobile-design/SKILL.md ]

If any item is unclear → ask the user before writing code.


Architecture principles

Widget tree discipline
❌ AVOID✅ DO
StatefulWidget for everythingUse StatelessWidget + state solution
Business logic inside widgetsExtract to controllers/notifiers/blocs
Deep nesting (>5 levels)Extract into named widgets
setState in large treesScoped rebuilds with Riverpod/BLoC
BuildContext passed downInheritedWidget / Provider / Riverpod
File structure (feature-first)
lib/
├── core/ # Shared utilities, theme, constants
│ ├── theme/
│ ├── utils/
│ └── errors/
├── features/ # Feature modules
│ ├── auth/
│ │ ├── data/ # Repos, data sources, DTOs
│ │ ├── domain/ # Entities, use cases
│ │ └── presentation/ # Screens, widgets, controllers
│ └── home/
├── shared/ # Shared widgets, components
└── main.dart

State management — Riverpod (preferred default)

Riverpod is the recommended choice for new Flutter projects. Use it unless the project already has BLoC/Provider established.

Provider types
NeedProvider
Simple valueProvider
Async data (future)FutureProvider
Stream-based dataStreamProvider
Mutable state + logicNotifierProvider / AsyncNotifierProvider
Global singleton (service)Provider
Riverpod patterns
dart
// Notifier with async logic
@riverpod
class UserNotifier extends _$UserNotifier {
@override
Future<User> build() async {
return ref.watch(userRepositoryProvider).getUser();
}
Future<void> updateProfile(String name) async {
state = const AsyncValue.loading();
state = await AsyncValue.guard(() =>
ref.read(userRepositoryProvider).update(name));
}
}
// Consuming in widget — scoped rebuild
class UserScreen extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final user = ref.watch(userNotifierProvider);
return user.when(
data: (u) => UserView(user: u),
loading: () => const CircularProgressIndicator(),
error: (e, _) => ErrorWidget(error: e),
);
}
}
BLoC (when project already uses it)
dart
// Event → Bloc → State pattern
class AuthBloc extends Bloc<AuthEvent, AuthState> {
AuthBloc(this._repo) : super(AuthInitial()) {
on<LoginRequested>(_onLoginRequested);
}
Future<void> _onLoginRequested(
LoginRequested event, Emitter<AuthState> emit) async {
emit(AuthLoading());
try {
final user = await _repo.login(event.email, event.password);
emit(AuthSuccess(user));
} catch (e) {
emit(AuthFailure(e.toString()));
}
}
}

Navigation — GoRouter (preferred)

dart
final router = GoRouter(
initialLocation: '/',
redirect: (context, state) {
final isLoggedIn = context.read<AuthNotifier>().isLoggedIn;
if (!isLoggedIn && !state.matchedLocation.startsWith('/auth')) {
return '/auth/login';
}
return null;
},
routes: [
GoRoute(path: '/', builder: (ctx, _) => const HomeScreen()),
GoRoute(
path: '/user/:id',
builder: (ctx, state) => UserScreen(id: state.pathParameters['id']!),
),
ShellRoute(
builder: (ctx, state, child) => ScaffoldWithNavBar(child: child),
routes: [ /* tab routes */ ],
),
],
);

Performance — mandatory checklist

CheckPattern
List renderingListView.builder with itemExtent when heights are fixed
Large listsflutter_lazy_load or pagination
Image loadingcached_network_image — never raw Image.network
Const widgetsAdd const to every widget constructor possible
Heavy buildsUse RepaintBoundary around animated sections
Unnecessary rebuildsWrap specific watchers, not whole screens
Memory leaksDispose controllers, subscriptions, animation controllers
dart
// Dispose correctly in StatefulWidget
@override
void dispose() {
_controller.dispose();
_subscription.cancel();
super.dispose();
}

Platform integration

Platform channels (native code bridge)
dart
// Dart side
const platform = MethodChannel('com.app/native');
Future<String> getNativeString() async {
try {
return await platform.invokeMethod<String>('getString') ?? '';
} on PlatformException catch (e) {
throw AppException('Native call failed: ${e.message}');
}
}
Conditional platform code
dart
import 'dart:io' show Platform;
Widget buildButton() {
if (Platform.isIOS) {
return CupertinoButton(onPressed: onTap, child: const Text('Go'));
}
return ElevatedButton(onPressed: onTap, child: const Text('Go'));
}

Firebase integration checklist

  • [ ] firebase_core initialized in main() before runApp
  • [ ] google-services.json (Android) and GoogleService-Info.plist (iOS) in correct locations
  • [ ] Firestore security rules set (never open allow read, write: if true)
  • [ ] Firebase Auth: use authStateChanges() stream, not one-off calls
  • [ ] Crash reporting: firebase_crashlytics initialized with FlutterError.onError

Testing patterns

dart
// Widget test
testWidgets('shows loading indicator', (tester) async {
await tester.pumpWidget(ProviderScope(
overrides: [userProvider.overrideWith(() => FakeUserNotifier())],
child: const MaterialApp(home: UserScreen()),
));
expect(find.byType(CircularProgressIndicator), findsOneWidget);
});
// Unit test — notifier
test('login succeeds', () async {
final container = ProviderContainer(overrides: [
authRepositoryProvider.overrideWithValue(FakeAuthRepo()),
]);
final notifier = container.read(authNotifierProvider.notifier);
await notifier.login('a@b.com', 'pass');
expect(container.read(authNotifierProvider), isA<AsyncData<User>>());
});

Build & release commands

TaskCommand
Run on deviceflutter run
Debug build (Android)flutter build apk --debug
Release build (Android)flutter build apk --release
App bundle (Play Store)flutter build appbundle --release
iOS releaseflutter build ios --release
Webflutter build web --release
Analyze codeflutter analyze
Run testsflutter test
Check doctorflutter doctor

Common errors and fixes

ErrorCauseFix
LateInitializationErrorlate var not initializedNull-check or initialize in initState
setState called after disposeAsync callback after widget unmountedCheck mounted before setState
Render overflowWidget too large for parentWrap in SingleChildScrollView or Flexible
Build context across async gapsOutdated BuildContextStore mounted check, or use ref (Riverpod)
Gradle sync failureSDK version mismatchflutter clean && flutter pub get
Pod install failureCocoaPods out of datepod repo update && pod install

Hard rules

  1. Never use `StatefulWidget` for business logic — extract to Notifier / BLoC / controller.
  2. Never call `setState` from outside the `State` class.
  3. Always dispose controllers — animation, text, page, scroll, stream subscriptions.
  4. Never block the main thread — heavy work goes in Isolate or compute().
  5. Always handle loading + error states in async consumers (no naked .data).
  6. Never store sensitive data in `SharedPreferences` — use flutter_secure_storage.
  7. Run `flutter analyze` before every task complete — treat warnings as errors.

Quick reference

Want toUse
State managementRiverpod (new) / BLoC (existing)
NavigationGoRouter
HTTPdio with interceptors, or http for simple
Image cachecached_network_image
Secure storageflutter_secure_storage
Push notificationsfirebase_messaging
Local storage (non-sensitive)shared_preferences / hive
Large listsListView.builder + itemExtent
Platform checksPlatform.isIOS / Platform.isAndroid
Native bridgeMethodChannel

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/utsavsavani08/rain-skill-main/flutter-expert/badge)](https://verified-skill.com/skills/utsavsavani08/rain-skill-main/flutter-expert)

Something wrong with this skill or its page? Tell us.