Skip to content

kodepirate/Dart-Class-Generator

Repository files navigation

Dart Data Class Generator

The Dart Data Class Generator is a VS Code extension that allows you to easily generate Dart data classes without writing boilerplate code. With this extension, you can create data classes for your Dart projects quickly and efficiently.

Features

Generate data classes with ease: This extension provides a simple command that generates a new Dart data class based on the selected properties. You can customize the data class template to fit your needs. Customizable templates: You can modify the default data class template or create your own to generate classes that match your project's needs. Configurable options: You can configure the extension to generate private or public fields, as well as include or exclude getters and setters.

Getting started

To use the Dart Data Class Generator extension, follow these steps:

  1. Install the extension from the Visual Studio Code Marketplace.
  2. Open the file you want to generate the data class in.
  3. Select the properties for the data class.
  4. Open the Command Palette (Ctrl+Shift+P on Windows or Cmd+Shift+P on Mac).
  5. Type "Generate Data Class" and select the "dcg.generateDataClass" command.
  6. Follow the prompts to customize the data class template and configuration.

Extension settings

The Dart Data Class Generator extension provides the following settings that you can configure:

  1. 'dcg.generatePrivateFields': A boolean value that determines whether the generated data class has private or public fields.
  2. 'dcg.includeGettersSetters': A boolean value that determines whether to include getters and setters in the generated data class.

To change these settings, open the VS Code settings editor (File > Preferences > Settings) and search for "Dart Data Class Generator".

Contributing

Contributions to the Dart Data Class Generator extension are welcome! To contribute, please fork the repository and create a pull request.

If you find a bug or have a feature request, please open an issue on the GitHub repository.

License

This extension is licensed under the MIT License.