Closed nzackoya closed 3 years ago
I have same problem.
@JsonKey( fromJson: getShapeDtoFromJson, toJson: getJsonFromShapeDto) final NgApiShapeDto? geometry;
It generate geometry: getShapeDtoFromJson(json['geometry'] as Map<String, dynamic>)
I have same problem.
@JsonKey( fromJson: getShapeDtoFromJson, toJson: getJsonFromShapeDto) final NgApiShapeDto? geometry;
It generate
geometry: getShapeDtoFromJson(json['geometry'] as Map<String, dynamic>)
Hey, as a workaround just change Map<String, dynamic>
to simply Map
in your getShapeDtoFromJson. It will generate as Map?
I changed to
NgApiShapeDto? getShapeDtoFromJson(Map? json)
It generated - getShapeDtoFromJson(json['geometry'] as Map?),
Thank you. Its great
This has been fixed in 4.1.3
For example we have fromJson for a field:
so generating from this
we get non nullable
Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.0.5, on macOS 11.2.3 20D91 darwin-x64, locale en-GB) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] Connected device (2 available)
flutter pub deps -- --style=compact Dart SDK 2.12.3 Flutter SDK 2.0.5
dependencies:
dev dependencies:
transitive dependencies: