{
    "url": "https://delaparra-services.nl/skills/flutter-new-module",
    "locale": "en",
    "title": "Flutter New Module | DeLaParra Services",
    "description": "Use when creating a new feature or module in a Flutter app (lib/modules/<feature>/) - generates the full skeleton: module with DI, Cubit controller, sealed status class, screen, widgets and route. Triggers on \"new screen\", \"new feature\" or \"new module\".",
    "alternates": {
        "en": "https://delaparra-services.nl/skills/flutter-new-module",
        "nl": "https://delaparra-services.nl/nl/skills/flutter-new-module"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/skills/flutter-new-module.csv",
        "md": "https://delaparra-services.nl/skills/flutter-new-module.md",
        "json": "https://delaparra-services.nl/skills/flutter-new-module.json",
        "zip": "https://delaparra-services.nl/skills/flutter-new-module.zip",
        "pdf": "https://delaparra-services.nl/skills/flutter-new-module.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/skills/flutter-new-module.csv",
            "encodingFormat": "text/csv",
            "name": "flutter-new-module.csv"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-new-module.json",
            "encodingFormat": "application/json",
            "name": "flutter-new-module.json"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-new-module.md",
            "encodingFormat": "text/markdown",
            "name": "flutter-new-module.md"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-new-module.pdf",
            "encodingFormat": "application/pdf",
            "name": "flutter-new-module.pdf"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-new-module.zip",
            "encodingFormat": "application/zip",
            "name": "flutter-new-module.zip"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-new-module/download",
            "encodingFormat": "application/zip",
            "name": "flutter-new-module-files.zip"
        }
    ],
    "markdown": "# Flutter New Module\n\n \n\nUse when creating a new feature or module in a Flutter app (lib/modules/\\<feature\\>/) - generates the full skeleton: module with DI, Cubit controller, sealed status class, screen, widgets and route. Triggers on \"new screen\", \"new feature\" or \"new module\".\n\n \n\n**Licence** MIT\n\n \n\n**Source** gabuldev/flutter-skills\n\n [Download zip](<https://delaparra-services.nl/skills/flutter-new-module/download>)   \n\nYou are creating a complete feature module for a scalable Flutter project - Cubit for state, ` flutter_injections ` for DI, one folder per feature under ` lib/modules/ `.\n\n \n\n## Input\n\n \n\n- Module name: from the request, or from the skill argument (e.g., \"payment\", \"order\", \"profile\"). **If no name was given, ask before creating any file** — it drives every directory, file and class name below, and renaming afterwards touches all of them. \n- If a second argument is given, it's the package path (e.g., \"../my\\_app/lib\") \n- If no path given, use the current package's ` lib/ ` directory\n\n \n\n## Module Structure to Create\n\n \n\nCreate ALL the following files for module ` <module_name> `:\n\n \n\n```\nmodules/<module_name>/\n├── <module_name>_module.dart          ← Module entry + DI registration\n└── presentation/\n    ├── <module_name>_controller.dart  ← Cubit (state machine)\n    ├── <module_name>_status.dart      ← State classes (sealed/abstract)\n    ├── <module_name>_screen.dart      ← Main UI screen\n    └── widgets/                       ← Module-specific widgets (if needed)\n```\n\n \n\nAnd in core (if new domain is needed):\n\n \n\n```\ndomain/\n├── entities/<module_name>.dart        ← Immutable entity (Equatable)\n├── repositories/<module_name>_repository.dart  ← Abstract interface\n└── usecases/<module_name>/\n    └── get_<module_name>_usecase.dart\n\ndata/\n├── models/<module_name>_model.dart    ← API model with .toEntity()\n├── datasources/<module_name>_datasource.dart  ← Dio HTTP calls\n└── repositories/<module_name>_repository_impl.dart\n```\n\n \n\n## File Templates\n\n \n\n### 1. Entity (domain/entities/\\<module\\_name\\>.dart)\n\n \n\n```\nimport 'package:equatable/equatable.dart';\n\nclass ModuleName extends Equatable {\n  final String id;\n  // add fields\n\n  const ModuleName({required this.id});\n\n  @override\n  List<Object?> get props => [id];\n}\n```\n\n \n\n### 2. Repository interface (domain/repositories/\\<module\\_name\\>\\_repository.dart)\n\n \n\n```\nimport '../entities/<module_name>.dart';\n\nabstract class <ModuleName>Repository {\n  Future<List<ModuleName>> getAll();\n}\n```\n\n \n\n### 3. Usecase (domain/usecases/\\<module\\_name\\>/get\\_\\<module\\_name\\>\\_usecase.dart)\n\n \n\n```\nimport '../../repositories/<module_name>_repository.dart';\nimport '../../entities/<module_name>.dart';\n\nclass Get<ModuleName>Usecase {\n  final <ModuleName>Repository _repository;\n  Get<ModuleName>Usecase(this._repository);\n\n  Future<List<ModuleName>> call() => _repository.getAll();\n}\n```\n\n \n\n### 4. API Model (data/models/\\<module\\_name\\>\\_model.dart)\n\n \n\n```\nimport '../../domain/entities/<module_name>.dart';\n\nclass <ModuleName>Model {\n  final String id;\n  // add fields from API\n\n  <ModuleName>Model({required this.id});\n\n  factory <ModuleName>Model.fromJson(Map<String, dynamic> json) =>\n      <ModuleName>Model(id: json['id']);\n\n  <ModuleName> toEntity() => <ModuleName>(id: id);\n}\n```\n\n \n\n### 5. Datasource (data/datasources/\\<module\\_name\\>\\_datasource.dart)\n\n \n\n```\nimport 'package:dio/dio.dart';\nimport '../models/<module_name>_model.dart';\n\nclass <ModuleName>Datasource {\n  final Dio _dio;\n  <ModuleName>Datasource(this._dio);\n\n  Future<List<<ModuleName>Model>> getAll() async {\n    final response = await _dio.get('/<module_name>s');\n    return (response.data as List)\n        .map((e) => <ModuleName>Model.fromJson(e))\n        .toList();\n  }\n}\n```\n\n \n\n### 6. Repository impl (data/repositories/\\<module\\_name\\>\\_repository\\_impl.dart)\n\n \n\n```\nimport '../../domain/entities/<module_name>.dart';\nimport '../../domain/repositories/<module_name>_repository.dart';\nimport '../datasources/<module_name>_datasource.dart';\n\nclass <ModuleName>RepositoryImpl implements <ModuleName>Repository {\n  final <ModuleName>Datasource _dataSource;\n  <ModuleName>RepositoryImpl(this._dataSource);\n\n  @override\n  Future<List<ModuleName>> getAll() async {\n    final result = await _dataSource.getAll();\n    return result.map((e) => e.toEntity()).toList();\n  }\n}\n```\n\n \n\n### 7. Status (presentation/\\<module\\_name\\>\\_status.dart)\n\n \n\n```\nabstract class <ModuleName>Status {\n  const <ModuleName>Status();\n}\n\nclass <ModuleName>Initial extends <ModuleName>Status {\n  const <ModuleName>Initial();\n}\n\nclass <ModuleName>Loading extends <ModuleName>Status {\n  const <ModuleName>Loading();\n}\n\nclass <ModuleName>Success extends <ModuleName>Status {\n  final List<<Entity>> items;\n  const <ModuleName>Success(this.items);\n}\n\nclass <ModuleName>Failure extends <ModuleName>Status {\n  final String message;\n  const <ModuleName>Failure(this.message);\n}\n```\n\n \n\n### 8. Controller (presentation/\\<module\\_name\\>\\_controller.dart)\n\n \n\n```\nimport 'package:flutter_bloc/flutter_bloc.dart';\nimport 'package:app_core/domain/usecases/<module_name>/get_<module_name>_usecase.dart';\nimport '<module_name>_status.dart';\n\nclass <ModuleName>Controller extends Cubit<<ModuleName>Status> {\n  final Get<ModuleName>Usecase _get<ModuleName>;\n\n  <ModuleName>Controller(this._get<ModuleName>) : super(const <ModuleName>Initial());\n\n  Future<void> load() async {\n    emit(const <ModuleName>Loading());\n    try {\n      final items = await _get<ModuleName>.call();\n      emit(<ModuleName>Success(items));\n    } catch (e) {\n      emit(<ModuleName>Failure(e.toString()));\n    }\n  }\n}\n```\n\n \n\n### 9. Screen (presentation/\\<module\\_name\\>\\_screen.dart)\n\n \n\n```\nimport 'package:flutter/material.dart';\nimport 'package:flutter_bloc/flutter_bloc.dart';\nimport '<module_name>_controller.dart';\nimport '<module_name>_status.dart';\n\nclass <ModuleName>Screen extends StatefulWidget {\n  const <ModuleName>Screen({super.key});\n\n  @override\n  State<<ModuleName>Screen> createState() => _<ModuleName>ScreenState();\n}\n\nclass _<ModuleName>ScreenState extends State<<ModuleName>Screen> {\n  @override\n  void initState() {\n    super.initState();\n    context.read<<ModuleName>Controller>().load();\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(title: const Text('<ModuleName>')),\n      body: BlocBuilder<<ModuleName>Controller, <ModuleName>Status>(\n        builder: (context, status) {\n          if (status is <ModuleName>Loading) {\n            return const Center(child: CircularProgressIndicator());\n          }\n          if (status is <ModuleName>Failure) {\n            return Center(child: Text(status.message));\n          }\n          if (status is <ModuleName>Success) {\n            return ListView.builder(\n              itemCount: status.items.length,\n              itemBuilder: (context, index) {\n                final item = status.items[index];\n                return ListTile(title: Text(item.id));\n              },\n            );\n          }\n          return const SizedBox.shrink();\n        },\n      ),\n    );\n  }\n}\n```\n\n \n\n### 10. Module entry + DI (\\<module\\_name\\>\\_module.dart)\n\n \n\n```\nimport 'package:flutter/material.dart';\nimport 'package:flutter_injections/flutter_injections.dart';\nimport 'package:app_core/domain/usecases/<module_name>/get_<module_name>_usecase.dart';\nimport 'package:app_core/domain/repositories/<module_name>_repository.dart';\nimport 'presentation/<module_name>_controller.dart';\nimport 'presentation/<module_name>_screen.dart';\n\nclass <ModuleName>Module extends FlutterModule {\n  const <ModuleName>Module({super.key});\n\n  @override\n  List<Inject<Object>> get injections => [\n        Inject<<ModuleName>Controller>.lazySingleton(\n          (i) => <ModuleName>Controller(\n            Get<ModuleName>Usecase(i.find<<ModuleName>Repository>()),\n          ),\n        ),\n      ];\n\n  @override\n  Widget get child => BlocProvider(\n        create: (_) => FlutterInjections.get<<ModuleName>Controller>(),\n        child: const <ModuleName>Screen(),\n      );\n}\n```\n\n \n\n## Instructions\n\n \n\n1. Read the existing project structure first to understand conventions \n1. Create all files above substituting ` <ModuleName> ` and ` <module_name> ` with the actual name \n1. Register the new repository and datasource in ` CoreInjections ` in ` core/lib/injections.dart ` \n1. Add the new route to the app's ` app_routes.dart ` \n1. Use the same import alias convention already in the project \n1. Do NOT add documentation comments or unnecessary annotations \n1. Keep controllers lean — only state transitions in controller, logic in usecases\n\n \n\n## Files\n\n \n\n- ` LICENSE ` \n- ` SKILL.md ` \n- ` SOURCE.md `\n\n \n\n## Related terms\n\n \n\n- [Flutter Feature Modules](<https://delaparra-services.nl/knowledge-hub/flutter-feature-modules>)\n\n \n\n## Related services\n\n \n\n- [App development](<https://delaparra-services.nl/services#service-02>)\n\n \n\n[Installing an agent skill in Claude Code, Codex, Cursor and Copilot](<https://delaparra-services.nl/manuals/een-skill-installeren-in-je-ai-assistent>)\n\n[HTML version](https://delaparra-services.nl/skills/flutter-new-module)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "WebPage",
                "@id": "https://delaparra-services.nl/skills/flutter-new-module#webpage",
                "url": "https://delaparra-services.nl/skills/flutter-new-module",
                "name": "Flutter New Module | DeLaParra Services",
                "description": "Use when creating a new feature or module in a Flutter app (lib/modules/<feature>/) - generates the full skeleton: module with DI, Cubit controller, sealed status class, screen, widgets and route. Triggers on \"new screen\", \"new feature\" or \"new module\".",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/skills/flutter-new-module#breadcrumb"
                }
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/skills/flutter-new-module#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Flutter New Module"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "SoftwareSourceCode",
                "@id": "https://delaparra-services.nl/skills/flutter-new-module#skill",
                "url": "https://delaparra-services.nl/skills/flutter-new-module",
                "name": "Flutter New Module",
                "description": "Use when creating a new feature or module in a Flutter app (lib/modules/<feature>/) - generates the full skeleton: module with DI, Cubit controller, sealed status class, screen, widgets and route. Triggers on \"new screen\", \"new feature\" or \"new module\".",
                "inLanguage": "en",
                "license": "https://spdx.org/licenses/MIT.html",
                "subjectOf": {
                    "@id": "https://delaparra-services.nl/skills/flutter-new-module#dataset"
                }
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/skills/flutter-new-module#dataset",
                "name": "Flutter New Module",
                "description": "Use when creating a new feature or module in a Flutter app (lib/modules/<feature>/) - generates the full skeleton: module with DI, Cubit controller, sealed status class, screen, widgets and route. Triggers on \"new screen\", \"new feature\" or \"new module\".",
                "url": "https://delaparra-services.nl/skills/flutter-new-module",
                "identifier": "https://delaparra-services.nl/skills/flutter-new-module#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/skills/flutter-new-module#skill"
                },
                "creditText": "gabuldev/flutter-skills",
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://spdx.org/licenses/MIT.html",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "dateModified": "2026-11-30T13:17:19+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#skills",
                    "name": "Skills for AI coding assistants",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "flutter-new-module.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-new-module.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-new-module.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-new-module.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-new-module.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-new-module.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-new-module.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-new-module.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-new-module.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-new-module.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-new-module-files.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-new-module/download",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    }
                ]
            }
        ]
    }
}