flutter-app-architecture
Use when scaffolding a project, refactoring into layers, creating view models/repositories, configuring dependency injection, or implementing unidirectional data flow (MVVM).
Install / Use
npx skills add evanca/flutter-ai-rules --skill flutter-app-architectureInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of flutter-app-architecture
flutter-app-architecture scores 90/100 on our quality scale, 1160th of 4,634 Development & Engineering skills we index (top 26%).
Its SKILL.md is 6.8 KB long, well organised into 14 sections with 6 code examples: a thorough specification that gives an agent plenty to work with.
It has 646 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 19 days ago, so flutter-app-architecture is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
flutter-app-architecture compared with similar skills
All 4 of these similar skills score higher than flutter-app-architecture; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| flutter-app-architecture (this skill)by evanca | 90 | 646 | 19d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 44.9k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | 3d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
Frequently asked questions
- How do I install flutter-app-architecture?
- Run
npx skills add evanca/flutter-ai-rules --skill flutter-app-architecture. The install tabs above show the steps for each supported agent. - Which AI agents does flutter-app-architecture work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is flutter-app-architecture safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is flutter-app-architecture still maintained?
- The repository was last updated 19 days ago, so flutter-app-architecture is actively maintained.
Skill content
View source on GitHubname: flutter-app-architecture description: "Use when scaffolding a project, refactoring into layers, creating view models/repositories, configuring dependency injection, or implementing unidirectional data flow (MVVM)." license: MIT
Flutter App Architecture Skill
This skill defines how to structure Flutter applications using layered architecture, proper data flow, and MVVM patterns for maintainability and testability.
When to Use
Use this skill when:
- Scaffolding a new Flutter project with layered architecture.
- Creating or refactoring View Models, Repositories, or Services.
- Wiring dependency injection between architectural components.
- Implementing unidirectional data flow across layers.
- Adding a Domain (Logic) Layer for complex business logic or shared use cases.
1. Layer Structure
Separate every app into a UI Layer and a Data Layer. Add a Logic (Domain) Layer only for complex apps.
┌──────────────────────────────────────────────────────────────┐
│ UI Layer │ Views + ViewModels │
├──────────────────────────────────────────────────────────────┤
│ Logic Layer │ Use Cases / Interactors (optional) │
├──────────────────────────────────────────────────────────────┤
│ Data Layer │ Repositories + Services │
└──────────────────────────────────────────────────────────────┘
Rules:
- Only adjacent layers may communicate. The UI layer must never access a Service directly.
- Data changes always happen in the Data layer (SSOT = Repository). No mutation in UI or Logic layers.
- Follow unidirectional data flow: state flows down (Data → UI), events flow up (UI → Data).
2. Component Responsibilities
View
- Describes how to present data; keep logic minimal and UI-related only.
- Passes events to the ViewModel in response to user interactions.
ViewModel
- Converts app data into UI state and maintains the current state needed by the View.
- Exposes callbacks (commands) to the View and retrieves/transforms data from Repositories.
class BookingViewModel extends ChangeNotifier {
final BookingRepository _repo;
BookingViewModel(this._repo);
List<Booking> _bookings = [];
List<Booking> get bookings => List.unmodifiable(_bookings);
bool _isLoading = false;
bool get isLoading => _isLoading;
Future<void> loadBookings() async {
_isLoading = true;
notifyListeners();
_bookings = await _repo.getBookings();
_isLoading = false;
notifyListeners();
}
Future<void> cancelBooking(String id) async {
await _repo.cancelBooking(id);
_bookings = await _repo.getBookings();
notifyListeners();
}
}
Repository (Single Source of Truth)
- The only class that may mutate its data; all other classes read from it.
- Handles caching, error handling, and data refresh logic.
- Transforms raw data from Services into domain models.
class BookingRepository {
final BookingApiService _apiService;
final BookingLocalService _localService;
BookingRepository(this._apiService, this._localService);
Future<List<Booking>> getBookings() async {
try {
final remote = await _apiService.fetchBookings();
await _localService.cacheBookings(remote);
return remote;
} catch (_) {
return _localService.getCachedBookings();
}
}
Future<void> cancelBooking(String id) async {
await _apiService.cancelBooking(id);
await _localService.removeCachedBooking(id);
}
}
Service
- Wraps API endpoints and exposes asynchronous response objects.
- Isolates data-loading and holds no state.
class BookingApiService {
final http.Client _client;
BookingApiService(this._client);
Future<List<Booking>> fetchBookings() async {
final response = await _client.get(Uri.parse('/api/bookings'));
if (response.statusCode != 200) {
throw HttpException('Failed to load bookings');
}
final data = jsonDecode(response.body) as List;
return data.map((json) => Booking.fromJson(json)).toList();
}
}
3. Dependency Injection
Supply dependencies via constructors. Define abstract interfaces so implementations can be swapped for testing.
// Abstract interface for the repository
abstract class BookingRepository {
Future<List<Booking>> getBookings();
Future<void> cancelBooking(String id);
}
// Concrete implementation
class BookingRepositoryImpl implements BookingRepository {
final BookingApiService _api;
BookingRepositoryImpl(this._api);
@override
Future<List<Booking>> getBookings() => _api.fetchBookings();
@override
Future<void> cancelBooking(String id) => _api.cancelBooking(id);
}
4. Use Cases (Domain Layer)
Introduce use cases only when:
- Logic is complex or does not fit cleanly in the UI or Data layers.
- Logic is reused across multiple ViewModels or merges data from multiple Repositories.
class GetUpcomingBookingsUseCase {
final BookingRepository _bookingRepo;
final UserRepository _userRepo;
GetUpcomingBookingsUseCase(this._bookingRepo, this._userRepo);
Future<List<Booking>> call() async {
final user = await _userRepo.getCurrentUser();
final bookings = await _bookingRepo.getBookings();
return bookings
.where((b) => b.userId == user.id && b.date.isAfter(DateTime.now()))
.toList();
}
}
5. Workflow: Scaffold a New Feature
- Create the Service — implement the API wrapper with typed response parsing.
- Create the Repository — inject the Service, implement caching and error-handling logic.
- Create the ViewModel — inject the Repository, expose UI state and commands.
- Create the View — bind to the ViewModel, render state, dispatch events.
- Wire DI — register all components in the dependency injection container.
- Verify — confirm the View never accesses the Service directly and data flows unidirectionally.
6. Data Storage
- Use key-value storage (e.g.,
shared_preferences) for configuration and preferences. - Use SQL storage (e.g.,
drift,sqflite) for complex relational data. - Implement optimistic updates to improve perceived responsiveness by updating UI before server confirms.
- Support offline-first by combining local and remote data sources in Repositories.
7. Coding Conventions
- Use
StatelessWidgetwhen possible; avoid unnecessaryStatefulWidgets. - Keep build methods simple and focused on rendering.
- Prefer
finalfor fields and top-level variables. Preferconstconstructors when the class supports it. - Prefer explicit typing on public APIs (e.g.,
Command0<void>over dynamic signatures). - Use descriptive constant names (e.g.,
_todoTableNameover_kTableTodo).
References
Related Skills
ai-job-search
44.9kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
