Skip to content

Upgrading source_gen 0.9 to 1

Breaking0.9.10+5 → 1.5.0Breaking5Platform2New6Changed14Fixed10Other1

BreakingUpgrade verdict

5 breaking changes and 2 platform requirement changes.

  • Code that catches this error as an Error, or uses the old name, must be updated.
  • Code that checked ConstantReader.isAny must be updated because that property no longer exists.
  • Code that read ConstantReader.anyValue must be updated because that property no longer exists.
  • Code that used LibraryReader.classElements must be updated because that property no longer exists.
Top 5 of 7 that need code or config changes

Dart SDK requirement changed in 1.4.0: >=2.11.999 <3.0.0 → ^3.0.0.

Breaking5
Renames InvalidGenerationSourceError to InvalidGenerationSource and changes it from an Error subtype to an Exception subtype.
InvalidGenerationSourceErrorInvalidGenerationSourceErrorException
Drops the deprecated ConstantReader.isAny API.
ConstantReader.isAny
Drops the deprecated ConstantReader.anyValue API.
ConstantReader.anyValue
Drops the deprecated LibraryReader.classElements API.
LibraryReader.classElements
Migrates the package to null safety.
Platform2
Requires Dart 3.0.
Requires Dart SDK version 2.18.