Enum Extensions Generator for Dart (VSCode Extension)
Table of Contents
Introduction
The "Enum Extensions Generator for Dart" is a Visual Studio Code (VSCode) extension designed to streamline the process of generating enum extensions in Dart. With this extension, you can quickly create extensions for your Dart enums, making your code more readable and maintainable. This extension simplifies the generation of enum extensions, saving you time and effort.
Features
- Automatically generate enum extensions from your Dart enums.
- Provides support for customizing the generated extension code.
- Improve code readability by easily accessing enum values.
- Enhance code maintainability with clear and concise extensions.
Installation
You can install this extension from the Visual Studio Code Marketplace by following these steps:
- Open Visual Studio Code.
- Go to the Extensions view by clicking on the square icon on the sidebar or pressing
Ctrl+Shift+X
.
- Search for "Enum Extensions Generator for Dart" in the search bar.
- Click "Install" to install the extension.
- After installation, the extension will be available for use.
Usage
- Open a Dart file containing an enum.
- Place the cursor within the enum you want to generate extensions for.
- Right-click inside the enum or use the command palette to access the extension's commands.
- Choose the "Generate Enum Extensions" command.
- The extension will generate the appropriate extensions for your enum, based on the naming convention used in Dart.
Example:
Given the following enum:
enum Status {
none,
hello,
success,
}
Running the extension will generate the following code:
extension StatusExt on Status {
bool get isNone => this == Status.none;
bool get isHello => this == Status.hello;
bool get isSuccess => this == Status.success;
}
Contributing
Contributions to this extension are welcome. If you have ideas for new features or improvements, please open an issue or create a pull request on the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy using the "Enum Extensions Generator for Dart" extension! If you find it useful, please consider giving it a star on GitHub. If you encounter any issues or have suggestions for improvements, feel free to open an issue. Happy coding!
Make sure to replace the placeholders like "yourusername" and "your-extension-repo" with your actual GitHub repository information. Customize the README to fit your specific extension and its features.