The CubitHelper extension for Visual Studio Code provides tools to streamline the development process for Flutter applications using the Cubit state management library. This extension helps with creating Cubit classes, synchronizing emitted states with state files, and setting up MVVM folder structures.
Features
Create Cubit Class:
Generates a new Cubit class along with a corresponding state file.
The class and state files are created in a user-specified folder within the workspace.
Synchronize Cubit States:
Extracts emitted states from the currently active Cubit class.
Updates the state file with any missing states based on the emitted states.
Create MVVM Folder Structure:
Automatically generates a folder structure for MVVM architecture.
Commands
cubithelper.createCubit
Creates a new folder and generates two Dart files: a Cubit file and a State file. The folder and file names are based on user input.
Usage
Open the command palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
Search for CubitHelper: Create Cubit and select it.
Enter the desired folder name when prompted.
cubithelper.syncCubitStates
Synchronizes the states in a Cubit class with the state file. It adds any missing states to the state file.
Usage
Open the Dart file containing the Cubit class in the editor.
Open the command palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
Search for CubitHelper: Sync Cubit States and select it.
cubithelper.createMVVMFolder
Creates an MVVM folder structure at the specified location.
Usage
Open the command palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
Search for CubitHelper: Create MVVM Folder and select it.
Choose the folder where you want to create the MVVM structure.