classy 0.2.1
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
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? #
-
Add
package:classy
to yourpubspec.yaml
- Run Command
dart pub add classy
- In
pubspec.yaml
file
dependencies: classy: any
-
Add the following code into your
analysis_options.yaml
analyzer: enable-experiment: - macros
-
When you're gonna run the project:
dart run --enable-experiment=macros path/main.dart