Tags
System
Created
April 1, 2023
This script helps you create a well-organized folder structure for your Flutter projects. By running it from the root/scripts
directory, it generates a consistent and logical layout for each feature in your app.
Benefits
- Improved Organization: The script automatically creates a clean and consistent folder structure, making your codebase easier to navigate and maintain.
- Team Collaboration: A standardized layout ensures all team members follow the same conventions, promoting seamless collaboration.
- Faster Onboarding: New developers can quickly understand the project layout, which speeds up development and reduces confusion.
- Time Saving: The script handles folder creation for you, so you can focus on writing code.
Folder Structure
abstracts
: Base classes or interfaces.adapters
: Classes responsible for adapting data between different formats or systems.analytics
: Classes and configurations related to analytics and tracking.api
: API-related classes, like clients, endpoints, and configurations.constants
: Constants used throughout the feature.converters
: Classes that convert data between different formats, like JSON to models.dtos
: Data Transfer Objects for passing data between layers.enums
: Enumerations specific to the feature.exceptions
: Custom exceptions related to the feature.extensions
: Extension methods for existing classes.forms
: Classes and configurations related to forms and form validation.models
: Data models representing the feature's domain entities.requests
: Classes representing API requests.responses
: Classes representing API responses.records:
Typedefs frames as records.services
: Services responsible for handling feature-specific logic.strings
: Localized strings for the feature.typedefs
: Type definitions specific to the feature.util
: Utility classes and helper functions for the feature.views
: Feature-specific views and screens.widgets
: Custom widgets related to the feature.
Usage
- Copy the script into your
root/scripts
folder. - Open a terminal and navigate to the
root/scripts
directory. - Run the script.
- Enter the name of the feature when prompted.
- The script will generate the folder structure for the feature in the
lib/features
directory.