This guide will help you set up and use the custom template for creating files with the VIPER architecture in your Flutter project.
Ensure you have the following installed:
- Visual Studio Code
- Flutter SDK
Open Visual Studio Code and install the following extensions:
- Download or clone the custom template files into your project directory.
- Ensure they are placed in a directory named
customTemplates
.
- Open each file in the
customTemplates
directory. - Update the package name in the imports to match your project's package name.
- Create a new folder for the scene you are working on.
- Name the folder according to the feature or scene it represents.
- Right-click on the new folder you created.
- Choose "Add Files from Custom Template".
- Select "VIPER" from the available templates.
- Follow the prompts to name the files appropriately by providing the required input.
- Right-click on the new folder again.
- Choose "GDBF: This folder" to generate a barrel file for easy imports.
Here’s an example of how you might set up a new scene:
- Create the Scene Folder:
lib/features/login
- Add Files from Template: Right-click on
login
and choose the VIPER template. - Rename Package Imports: Ensure all imports reflect your project's structure.
- Generate Barrel File: Right-click on
login
and chooseGDBF: This folder
.
- Ensure your project structure remains organized by following a consistent naming convention.
- Regularly update the custom template to include any new modifications or best practices.
By following these steps, you can streamline the process of setting up new scenes in your Flutter project using the VIPER architecture. This ensures consistency and improves development efficiency.