mobile_flutter
Flutter/Dart best practices, Riverpod state management ve performance optimization.
npxskills add vuralserhat86/antigravity-agentic-skills--skill mobile_flutterLoading…
Flutter/Dart best practices, Riverpod state management ve performance optimization.
npxskills add vuralserhat86/antigravity-agentic-skills--skill mobile_flutterLoading…
Flutter/Dart best practices ve performance optimization.
lib/
├── core/
│ ├── theme/
│ └── widgets/
├── features/
│ ├── auth/
│ │ ├── data/
│ │ ├── domain/
│ │ └── presentation/
│ └── home/
├── services/
└── main.dart
// ✅ const constructor kullan
class MyButton extends StatelessWidget {
const MyButton({super.key, required this.onPressed});
final VoidCallback onPressed;
@override
Widget build(BuildContext context) {
return ElevatedButton(onPressed: onPressed, child: Text('Click'));
}
}
// ✅ const widget'ları işaretle
const SizedBox(height: 16),
final authProvider = StateNotifierProvider<AuthNotifier, AuthState>((ref) {
return AuthNotifier(ref.watch(authRepositoryProvider));
});
class AuthNotifier extends StateNotifier<AuthState> {
AuthNotifier(this._repo) : super(const AuthState());
Future<void> login(String email, String password) async {
state = state.copyWith(isLoading: true);
final user = await _repo.login(email, password);
state = state.copyWith(user: user, isLoading: false);
}
}
// ✅ ListView.builder (lazy loading)
ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) => ItemCard(item: items[index]),
)
// ✅ RepaintBoundary
RepaintBoundary(child: ExpensiveWidget())
// ✅ Isolate for CPU-heavy
final result = await compute(parseUsers, jsonString);
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
final storage = FlutterSecureStorage();
await storage.write(key: 'token', value: token);
final token = await storage.read(key: 'token');
// MediaQuery
final isTablet = MediaQuery.of(context).size.width > 600;
// LayoutBuilder
LayoutBuilder(
builder: (context, constraints) {
return constraints.maxWidth > 600 ? WideLayout() : NarrowLayout();
},
)
Mobile Flutter v1.1 - Enhanced
Kaynak: Flutter Engineering Best Practices & Riverpod Architecture
NotifierProvider ve Code Generation (@riverpod) kullan.const constructorları kullanarak rebuild'leri minimize et.flutter_secure_storage, cache için Isar veya Hive kullan.| Aşama | Doğrulama |
|---|---|
| 1 | Business logic UI'dan (Widget'lardan) tamamen ayrılmış mı? |
| 2 | App cold start süresi <2 saniye mi? |
| 3 | Farklı ekran boyutlarında (Tablet/Foldable) responsive davranıyor mu? |
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).