classy 0.2.1 copy "classy: ^0.2.1" to clipboard
classy: ^0.2.1 copied to clipboard

This is a package to simplify your dart code, specially classes and make your code more Classy and Cleaner without the normal boilerplate

logo

pub package License: MIT

This is a package to simplify your dart code, specially classes and make your code more Classy and Elegant without the normal boilerplate


✨ Features #


😎 @data calls the @constructor, @toJson, @fromJson and @toString to generate the complete class for you.


🏗️ @constructor it generates a constructor, and you can choose if you want NamedConstructor or PositionConstructor.


⬇️ @fromJson to instantiate the class from a json, that normally come from a server.


⬆️ @toJson to convert the class instance into a JSON map, which can be sent to a server or used elsewhere in your application.


📜 @toString for a readable string representation of the class.



🚀 How to Run? #

  1. Add package:classy to your pubspec.yaml

    • Run Command
    dart pub add classy
    
    • In pubspec.yaml file
    dependencies:
        classy: any
    
  2. Add the following code into your analysis_options.yaml

    analyzer:
        enable-experiment:
            - macros
    
  3. When you're gonna run the project:

    dart run --enable-experiment=macros path/main.dart
    

⚠️ Requires Dart SDK >= 3.5.0 #

0
likes
140
points
29
downloads
screenshot

Publisher

unverified uploader

Weekly Downloads

This is a package to simplify your dart code, specially classes and make your code more Classy and Cleaner without the normal boilerplate

Repository (GitHub)

Topics

#macros #code-generation

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

macros

More

Packages that depend on classy