Skip to content

millsteed/macros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macros

Experiments with upcoming Dart macros

Setup

  • Update your SDK to a dev build (this was written on 3.4.0-77.0.dev)
  • For Flutter users: flutter channel master
  • Add --enable-experiment=macros to dart invocations
  • In VS Code update to the Pre-Release Dart/Flutter extensions

@Model()

This is a replacement for the freezed and json_serializable packages.

It implements fromJson, toJson, copyWith, toString, operator == and hashCode.

See bin/model.dart for an example.

See lib/model.dart for implementation.

Disclaimer

I've definitely missed edge cases. Create an issue or a pull request. Do not use in production yet.

About

Experiments with upcoming Dart macros

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages