xyz_gen 0.37.0
xyz_gen: ^0.37.0 copied to clipboard
A package designed to generate boilerplate code, reducing the amount of repetitive code you need to write.
π½πΎπΏ Gen #
This package is designed to help you speed up development by generating boilerplate code for your projects.
It comes with a set of generators that can be used as-is, or modified to suit your needs. Some generators use templates to create files, while others use code to modify existing files. These templates can be modified to suit your needs and can be found in the templates folder.
To make your own generators, use the tools in this package. Fork the repository here and add your generators.
π Documentation and video tutorials are coming soon.
Included Generators #
βοΈ generate_directives.dart #
A quick way to create missing import/export or part of directives to your files.
βοΈ generate_exports.dart #
Looks through a folder for all Dart files and creates an exports file that includes them all, simplifying your project.
βοΈ enerate_license_headers.dart #
Adds license headers to your files, helping to protect your work.
βοΈ generate_makeups.dart #
Generates Makeups for widgets, giving them extra styles or features with ease.
βοΈ generate_models.dart #
Creates model classes from class annotations, handling types better than `json_serializable``.
βοΈ generate_preps.dart #
Inserts helpful information like line numbers and file names to keep things organized.
βοΈ generate_type_utils.dart #
Generates some utils for annotated Enums.
βοΈ generate_screen.dart (π οΈ not ready for public use) #
Creates Screens for your app, including the boilerplate code needed to get them up and running.
βοΈ generate_screen_access.dart (π οΈ not ready for public use) #
Connects your Screens to the navigator.
βοΈ generate_configurations.dart (π οΈ not ready for public use) #
Generates code to connect your Screens to your app.
Getting Started #
Installation #
- Add this to your package's
pubspec.yamlfile, whereanyis the latest version:
dependencies:
xyz_gen: any
- Navigate to your project directory by running
cd your/project/paththen clone the generator scripts viagit clone https://github.com/robmllze/___generators.git. - Modify the generators as needed. You may also wish to change the generator templates to suit your needs.
- Run any of the generator scripts via
dart ___generators/<GENERATOR>.dartwhere<GENERATOR>can be any of the included generators, likedart generate_models.dart. - Consider setting up keyboard shortcuts or single-click actions to quickly run the generators and enhance your workflow efficiency. For instance, in VS Code, you can configure a task to execute the generators. Learn more: https://code.visualstudio.com/docs/editor/tasks.
Contributing #
Contributions to XYZ Gen are welcome. Here are a few ways you can help:
- Report bugs and make feature requests.
- Add new generators.
- Improve the existing generators.
- Helo with documentation and tutorials.
If you would like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
License #
This package is released under the MIT License.
Contact #
Author: Robert Mollentze
Email: robmllze@gmail.com