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

Libraries

classy