skip to Main Content

I have added JsonCodable to Latest flutter verion 3.22.0 for JsonData class. But some how Dart analysis server is throwing error. I have also added macros to pubspec.yaml and made enable-experiment to this file.

Pubspec.yaml

pubspec.yaml

Analysis Options.yaml

analysis_options.yaml

my_code.dart

sample.dart

2

Answers


  1. Chosen as BEST ANSWER

    I am on Flutter 3.22.0, doc says I need to be on Flutter master channel.

    https://dart.dev/language/macros#the-jsoncodable-macro


  2. For that annotation you need to add json: ^0.20.1 package in your pubspec.yaml

    See

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search