Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Flutter ArchitectNew to Visual Studio Code? Get it now.
Flutter Architect

Flutter Architect

Emre Y

|
1 install
| (0) | Free
Build your Flutter architecture your way. Scaffold Clean, Feature-First or custom architectures with Cubit, Bloc, GetIt, Riverpod, GoRouter and more.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Flutter Architect

Build your Flutter architecture your way.

CI License: MIT

Flutter Architect is a Visual Studio Code extension that sets up the architecture of a Flutter app (state management, dependency injection, data layer, network, routing, models, storage, theme) and then generates features, Cubits, Blocs, services, models, widgets and pages that follow it. You choose every technology; nothing you did not choose is generated, and your existing files are never changed without your approval.

Dashboard overview

Architecture Wizard summary Feature generator
Project Analysis Templates

🇹🇷 Türkçe dokümantasyon: README.tr.md

  • Installation
  • Quick start
  • Languages
  • Architecture Wizard: every option and what it creates
  • Folder structures
  • Generators
  • Project Analysis
  • Custom templates
  • Safety: preview, dry run, undo
  • Commands and settings
  • Testing
  • FAQ

Installation

From the Marketplace

  1. Open VS Code → Extensions (Ctrl+Shift+X / Cmd+Shift+X).
  2. Search for Flutter Architect and click Install.

From a .vsix file

code --install-extension flutter-architect-<version>.vsix

or Extensions view → … menu → Install from VSIX…

Requirements: VS Code 1.95+, Flutter SDK (found through the Dart extension's dart.flutterSdkPath, FLUTTER_ROOT or PATH). Generating code works offline; adding packages runs flutter pub add and needs internet access.

Quick start

  1. Open a Flutter project, or create one from the dashboard (Create new Flutter project).
  2. Run Flutter Architect: Open Dashboard (Ctrl/Cmd+Shift+P) or click the layers icon in the activity bar.
  3. Architecture → Start the Architecture Wizard → pick your options → Summary.
  4. Review the files, compare existing ones, optionally run a Dry run report, then Create architecture.
  5. Features → enter products → Preview → Create files.
  6. Run flutter analyze — the generated code is analyzer-clean.

Languages

What Language
Dashboard, messages, command titles English or Turkish
Generated Dart code (class names, comments, UI texts) Always English
Names you type (feature, model, field names) Any language — converted to valid Dart names

Change the interface language: dashboard → Settings → Interface language, or VS Code settings → flutterArchitect.language:

  • auto (default) — follows VS Code's display language (Configure Display Language)
  • en — English
  • tr — Türkçe

Command titles in the Command Palette follow VS Code's display language.

Names in other languages are converted by the central Naming Generator:

You type Folder / file Class
products features/products/ · product_cubit.dart ProductCubit
Order Items features/order_items/ · order_item_model.dart OrderItemModel
Ürün Kategorileri features/urun_kategorileri/ UrunKategorileriCubit
created_at (field) — field createdAt, JSON key created_at

Accented letters are transliterated (ç→c, ğ→g, ı→i, ö→o, ş→s, ü→u). English plurals are singularized (products → Product, categories → Category); other languages keep the word as typed.

Architecture Wizard

The wizard asks nine questions. Each answer decides which files are created — and which are not. Choices are saved to .flutter_architect/config.json and used by every generator afterwards.

Step Option Creates
Architecture Pragmatic Feature-First (default) features/<name>/data + presentation, full shared/
Clean Architecture adds domain/ (entities, repository interfaces, use cases) and core/usecases/usecase.dart
Feature-First flat feature folders (models/, services/, pages/ …), lean shared/
Custom you pick the optional folders (core/extensions, shared/*)
State management Cubit xxx_cubit.dart + xxx_state.dart, AppBlocObserver
Bloc xxx_bloc.dart + xxx_event.dart + xxx_state.dart
Both choose Cubit or Bloc per feature (saved as a feature override)
None no state files; pages load data with FutureBuilder / Riverpod FutureProvider
Dependency injection GetIt core/di/injection.dart (sl), features are registered automatically
GetIt + Injectable injection.dart + app_module.dart, @injectable annotations, build_runner
Riverpod core/di/providers.dart, ProviderScope; per-feature xxx_providers.dart; no GetIt
Provider core/di/app_providers.dart, MultiProvider; no GetIt
Manual core/di/app_dependencies.dart passed down explicitly; no service locator
Data access Service + IService (default) i_xxx_service.dart + xxx_service.dart
Repository + DataSource i_xxx_remote_data_source.dart, xxx_remote_data_source.dart, i_xxx_repository.dart, xxx_repository.dart
Service + Repository service files + repository files wrapping the service
Custom no data files
Network Dio core/network/network_manager.dart + network_interceptor.dart, error mapping to NetworkException
HTTP core/network/network_manager.dart on package:http with timeouts
Custom core/network/network_client.dart interface only
None no network files; feature data sources are in-memory
Routing GoRouter core/routing/app_router.dart + route_paths.dart
AutoRoute app_router.dart (@AutoRouterConfig), build_runner
Navigator 1.0 onGenerateRoute table
Navigator 2.0 RouterDelegate + RouteInformationParser
None no router; MaterialApp(home: HomePage())
Model generation Manual JSON fromJson, toJson, copyWith, ==, hashCode written out
json_serializable @JsonSerializable() + part '*.g.dart'
Freezed + json_serializable @freezed models + *.freezed.dart / *.g.dart
Storage Shared Preferences / Secure Storage / Both core/storage/preferences_storage.dart, secure_storage.dart
Custom core/storage/key_value_storage.dart interface
None no storage files
Theme Light + Dark / Light only / Dark only core/theme/app_theme.dart with only the chosen themes

Always created: main.dart, app/app.dart, app/bootstrap.dart (error handling, DI start), app/home_page.dart, core/config/app_config.dart (--dart-define), core/constants, core/errors, core/utils/result.dart (Result = Success | Failure), test/widget_test.dart.

Packages are added with a single flutter pub add call, so pub picks versions that are compatible with each other and with your Flutter SDK, written as caret constraints (never any). Already installed packages are skipped. You can untick this and add them later.

Folder structures

Generated by the wizard plus one feature (products, fields id: int, name: String, pages list/detail/form).

Pragmatic Feature-First · Cubit · GetIt · Service + IService · Dio · GoRouter (defaults)

lib/
├── app/          app.dart · bootstrap.dart · home_page.dart
├── core/
│   ├── config/       app_config.dart
│   ├── constants/    app_constants.dart
│   ├── di/           injection.dart
│   ├── errors/       app_exception.dart
│   ├── extensions/   context_extensions.dart
│   ├── network/      network_manager.dart · network_interceptor.dart
│   ├── routing/      app_router.dart · route_paths.dart
│   ├── storage/      preferences_storage.dart
│   ├── theme/        app_theme.dart
│   └── utils/        app_bloc_observer.dart · result.dart
├── features/
│   └── products/
│       ├── data/
│       │   ├── models/     product_model.dart
│       │   └── services/   i_product_service.dart · product_service.dart
│       └── presentation/
│           ├── cubit/      product_cubit.dart · product_state.dart
│           ├── pages/      products_page.dart · product_detail_page.dart · product_form_page.dart
│           └── widgets/    product_list_tile.dart
├── shared/       dialogs/ · enums/ · formatters/ · helpers/ · models/ · widgets/
└── main.dart

Clean Architecture · Bloc · GetIt + Injectable · Repository + DataSource · HTTP · AutoRoute · Freezed

lib/
├── app/          app.dart · bootstrap.dart · home_page.dart
├── core/
│   ├── di/           injection.dart · app_module.dart
│   ├── network/      network_manager.dart
│   ├── routing/      app_router.dart
│   ├── storage/      preferences_storage.dart · secure_storage.dart
│   ├── usecases/     usecase.dart
│   └── …             config · constants · errors · extensions · theme · utils
├── features/
│   └── products/
│       ├── data/
│       │   ├── data_sources/  i_product_remote_data_source.dart · product_remote_data_source.dart
│       │   ├── models/        product_model.dart            (toEntity())
│       │   └── repositories/  product_repository.dart
│       ├── domain/
│       │   ├── entities/      product.dart
│       │   ├── repositories/  i_product_repository.dart
│       │   └── use_cases/     get_products.dart
│       └── presentation/
│           ├── bloc/          product_bloc.dart · product_event.dart · product_state.dart
│           ├── pages/         products_page.dart · product_detail_page.dart · product_form_page.dart
│           └── widgets/       product_list_tile.dart
├── shared/       dialogs/ · enums/ · helpers/ · models/ · widgets/
└── main.dart

Feature-First · no state management · Riverpod · no network · no routing

lib/
├── app/          app.dart · bootstrap.dart · home_page.dart
├── core/         config/ · constants/ · di/providers.dart · errors/ · extensions/ · theme/ · utils/result.dart
├── features/
│   └── products/
│       ├── models/      product_model.dart
│       ├── pages/       products_page.dart · product_detail_page.dart · product_form_page.dart
│       ├── providers/   product_providers.dart
│       ├── services/    i_product_service.dart · product_service.dart   (in-memory)
│       └── widgets/     product_list_tile.dart
├── shared/       helpers/ · widgets/
└── main.dart

Generators

All generators read .flutter_architect/config.json, so they follow the architecture you chose. Run the Architecture Wizard first.

Command / dashboard What you enter What is created
Create Feature (Features section) name, state (project default or Cubit/Bloc/None), fields, parts model, data layer, Cubit/Bloc, list/detail/form pages, list tile, DI registration
Scaffold Feature (Explorer right-click on a folder, Ctrl/Cmd+Alt+Shift+F) name only the whole feature folder from your saved architecture (asks: plain Dart class model or json_serializable / Freezed; the choice is remembered), after a file list approval
Create Cubit feature xxx_cubit.dart + xxx_state.dart (Initial, Loading, Success, Error)
Create Bloc feature xxx_bloc.dart + xxx_event.dart + xxx_state.dart
Create Service feature, optional model fields interface + implementation (+ model)
Create Model name, fields, feature or lib/shared/models model in the chosen serialization
Create Widget name, Stateless / Stateful / Custom (with properties) widget in the feature or lib/shared/widgets
Create Common Widget (Explorer right-click, Ctrl/Cmd+Alt+Shift+W) name, Stateless (default) / Stateful, wrapped widget: TextFormField, Elevated/Filled/Outlined/Text button, DropdownButtonFormField custom_text_form_field.dart → CustomTextFormField with the required fields (e.g. textEditingController → controller:), in the clicked folder or lib/shared/widgets
Create Page List / Detail / Form / Empty page wired to the feature's Cubit/Bloc or data layer
Register Dependency class from lib/ (suggested), lifecycle registration in your DI (see below)
Generate Routing page class, optional URL path route in your router (see below)
Add Network Dio or HTTP NetworkManager, NetworkException, DI registration, config update; with Dio also auth (Bearer token), 401 and retry interceptors
Add Storage Shared Preferences / Secure Storage / Both storage wrappers, DI registration, config update

Fields are written as name: Type, comma or line separated:

id: int, name: String, price: double?, active: bool,
tags: List<String>, created_at: DateTime, meta: Map<String, dynamic>, owner: UserModel?

Per-feature state management: a feature can use Bloc even if the project default is Cubit. The choice is saved under features in config.json.

Register Dependency

The class is registered as its I<Name> interface when it implements one, otherwise as itself. Required constructor parameters are resolved from the container; values a container cannot provide (String, int, callbacks …) stop the registration and the preview explains why.

DI Where the registration goes Example
GetIt core/di/injection.dart, above // flutter_architect:registrations sl.registerLazySingleton<IProductService>(() => ProductService(sl<NetworkManager>()))
GetIt + Injectable an annotation on the class (then run build_runner) @LazySingleton(as: IProductService)
Riverpod core/di/providers.dart (dependencies via existing providers) final productServiceProvider = Provider<IProductService>((ref) => ProductService(ref.watch(networkManagerProvider)));
Provider the buildAppProviders() list Provider<IProductService>(create: (context) => ProductService(context.read<NetworkManager>()))
Manual snippet for AppDependencies —

Lifecycles: Lazy singleton (default), Singleton, Factory (new instance each time — use it for Cubits and Blocs). The feature generator registers its own classes automatically when Register dependencies is on.

Generate Routing

Router What is added
GoRouter static const String productDetail = '/product-detail'; in RoutePaths and a GoRoute in app_router.dart; a model parameter is passed with context.push(path, extra: item)
AutoRoute AutoRoute(page: ProductDetailRoute.page, path: '/product-detail'), @RoutePage() on the page, argument imports; run build_runner
Navigator 1.0 a case in the onGenerateRoute table; a model parameter is read from settings.arguments
Navigator 2.0 step-by-step instructions (custom delegates are not edited automatically)
None choose a router in the wizard first

The URL path is derived from the class name (ProductDetailPage → /product-detail) unless you enter one. Pages that need values a route cannot pass (for example int id) get a snippet instead of an edit. The feature generator can add its pages to the router directly (Add the pages to the router).

Add Network / Add Storage

For projects that started with Network: None or Storage: None/Custom: the wrappers are created, NetworkException is added to app_exception.dart when missing, the services are registered in your DI and config.json is updated. Projects that already have the layer are told so and nothing changes.

Project Analysis

Flutter Architect: Analyze Project (or the Project Analysis section) inspects the active project and never changes it.

Check Severity
Imports and part files that point to files that do not exist Error
Packages that are imported but not declared in pubspec.yaml Error
Files the saved architecture expects but that are missing Warning
config.json names a technology whose package is not installed Warning
Dependencies that no Dart file imports (packages the architecture adds for later are Info) Warning
Duplicate folders (widget / widgets, Utils / utils) and similar features (product / products) Warning
Several state management, DI or routing packages at once Info
No architecture configuration yet Info

The report also shows the folder structure (feature-first, Clean, layer-first …), file counts, features and the detected stack. Click a finding to open the file at that line; Export report opens it as Markdown. Imports of files produced by build_runner (*.g.dart, *.config.dart …) are not reported.

Custom templates

Templates live in your project, so the whole team shares them through version control:

.flutter_architect/templates/
└── team_feature/
    ├── template.json                       name, description
    └── files/
        └── lib/features/{{feature.snake}}/
            ├── data/models/{{entity.snake}}_model.dart
            └── presentation/cubit/{{entity.snake}}_cubit.dart
  1. Templates section → Create a template → choose what to start from (complete feature for your current architecture, Cubit, Bloc, model + data layer, model or page) → Create from built-in.
  2. Edit, add or delete files in the template folder. Paths and contents may use the placeholders below.
  3. Use → enter a name (e.g. order items) → Preview → Create files (same preview, approval and undo as every generator).
  4. Export saves the template as one .fatemplate.json file; Import template… adds it to another project.
Placeholder order items in my_app
{{package}} my_app
{{feature.snake}} / {{feature.camel}} / {{feature.pascal}} order_items / orderItems / OrderItems
{{feature.kebab}} / {{feature.title}} / {{feature.words}} order-items / Order Items / order items
{{entity.snake}} / {{entity.camel}} / {{entity.pascal}} order_item / orderItem / OrderItem
{{entity.kebab}} / {{entity.title}} / {{entity.words}} order-item / Order Item / order item

Templates are logic-less: placeholders are replaced, nothing is executed, so importing a template from someone else cannot run code on your machine. Rendered files can only be written to lib/ or test/; unknown placeholders and unsafe paths are rejected before anything is written.

Safety

  • Preview first — every run lists new, unchanged and existing files before anything is written.
  • Existing files are kept unless you tick them; Compare opens a side-by-side diff. Only untouched flutter create template files and intended updates (DI registrations, config) are pre-selected.
  • Dry run report — a Markdown report of what would happen, nothing written.
  • All or nothing — if writing fails or you cancel, everything written so far is rolled back.
  • Undo — reverts the last run, even after a window reload; files you edited afterwards are kept.
  • Path protection — generated paths can never leave the project (.., absolute and reserved names are rejected).
  • Formatted output — code is formatted with your dart format before the preview, so what you review is exactly what is written.
  • Private and offline — no telemetry, no server; your code never leaves your machine.

Commands and settings

All commands are in the Command Palette under Flutter Architect: — Open Dashboard · Initialize Architecture · Create Feature · Scaffold Feature · Create Cubit · Create Bloc · Create Service · Create Model · Create Widget · Create Common Widget · Create Page · Register Dependency · Generate Routing · Analyze Project · Open Settings · Refresh Flutter Projects.

Setting Default Description
flutterArchitect.language auto Interface language: auto, en, tr
flutterArchitect.showStatusBarItem true Show the active Flutter project in the status bar

FAQ

I don't see my project. The project needs a pubspec.yaml with flutter: sdk: flutter. Use Refresh Flutter Projects. Folders ignored by .gitignore are not scanned.

The generated code needs build_runner. Injectable, AutoRoute, json_serializable and Freezed use code generation. Click Run build_runner on the result screen or run dart run build_runner build --delete-conflicting-outputs.

Can I change my choices later? Yes. Run the wizard again: it starts from the saved choices, shows what changes and only creates missing files. Existing code is never rewritten automatically.

Where do new routes go? Use Generate Routing, or tick Add the pages to the router when creating a feature.

Can I edit the generated DI or router files? Yes. Edits are surgical: a registration is inserted above the marker, a route is appended to the existing list. If the structure is not recognised, nothing is changed and you get the code to paste.

Development

npm install
npm test                  # typecheck, lint, unit tests (no VS Code window)
npm run test:integration  # integration tests in a temporary VS Code window
npm run test:flutter      # generate into real Flutter projects; flutter analyze + flutter test
npm run package           # build the .vsix

See docs/ARCHITECTURE.md and PUBLISHING.md.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft