xyz_gen 0.62.3 copy "xyz_gen: ^0.62.3" to clipboard
xyz_gen: ^0.62.3 copied to clipboard

This package contains a set of generators to help you with your Flutter projects.

πŸ‡½πŸ‡ΎπŸ‡Ώ Gen #

pub package

This package contains a set of generators to help you with your Flutter 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 hard-coded logic to generate or modify existing files. These templates can be modified to suit your needs and can be found in the templates folder.

To create your own generators, fork this package from https://github.com/robmllze/xyz_gen and customize it as needed or use this package as a dependency in your own package.

Documentation #

πŸ”œ Documentation and video tutorials are coming soon. Feel free to contact me for more information.

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.

βš™οΈ generate_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. Feel free to contact me for more information.

βš™οΈ generate_screen_access.dart (πŸ› οΈ not ready for public use) #

Connects your Screens to the navigator. Feel free to contact me for more information.

βš™οΈ generate_bindings.dart (πŸ› οΈ not ready for public use) #

Generates code to connect your Screens to your app. Feel free to contact me for more information.

Getting Started #

Installation #

If you are only interested in using the existing generators, there's no need to include this package, but you'll need to include the annotations package by modifying your pubspec.yaml file:

dependencies:
  xyz_gen_annotations: any  # or the latest version

If you want to use the tools included in this package to create your own generators package, you can include it like so:

dependencies:
  xyz_gen: any # or the latest version

Next Steps #

1. Clone the Generator Scripts:

Navigate to your project directory by running cd your/project/path in your terminal. Then clone the generator scripts repository:

On macOS and Linux:
rm -rf ___generators/
git clone https://github.com/robmllze/___generators.git
dart pub get -C ___generators
On Windows:
rmdir /s /q ___generators/
git clone https://github.com/robmllze/___generators.git
dart pub get -C ___generators
rmdir /s /q ___generators/.git

This will clone the generator scripts into your project directory and remove the .git directory, effectively detaching it from version control so that you can modify it as needed.

2. Modify the Generators as Needed:

Once cloned, you can modify the generator scripts or templates according to your project requirements.

3. Run the Generator Scripts:

Execute any of the generator scripts from the root of your project directory:

dart ___generators/generate_models.dart

Replace generate_models.dart with the specific generator you wish to run, for example, dart generate_exports.dart.

4. Enhance Workflow Efficiency with VS Code Extensions:

You can also install the xyz-run-script extension to run the generators with a right click or use the xyz-run-tasks extension to run the generators via the explorer menu.

Contributing #

Contributions are welcome. Here are a few ways you can help:

  • Report bugs and make feature requests.
  • Add new features.
  • Improve the existing code.
  • Help with documentation and tutorials.

License #

This project is released under the MIT License. See LICENSE for more information.

Contact #

Author: Robert Mollentze

Email: robmllze@gmail.com

7
likes
140
pub points
60%
popularity

Publisher

unverified uploader

This package contains a set of generators to help you with your Flutter projects.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

analyzer, args, collection, path, xyz_gen_annotations, xyz_utils

More

Packages that depend on xyz_gen