We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import 'package:freezed_annotation/freezed_annotation.dart';
part 'income_dto.freezed.dart';
part 'income_dto.g.dart';
@freezed abstract class IncomeDto with _$IncomeDto { const factory IncomeDto({ @required String id, @required num amount, }) = _IncomeDto;
factory IncomeDto.fromJson(Map<String, dynamic> json) => _$IncomeDtoFromJson(json);
factory IncomeDto.unknown(num amount) => IncomeDto( id: '', amount: amount, ); }
Its giving this error
Could not generate fromJson code for copyWith. To support the type _$IncomeDtoCopyWith you can:
fromJson
copyWith
_$IncomeDtoCopyWith
JsonConverter
JsonKey
toJson
The text was updated successfully, but these errors were encountered:
@rrousselGit this is only a problem with 0.12.5. @gullucktheapp you might want to use 0.12.4 or lesser version
Sorry, something went wrong.
Fix Freezed generating code from constructors that do not rely on Fre…
62c07f6
…ezed fixes #323, fixes #324
59f5473
This was fixed as part of 0.12.6
No branches or pull requests
import 'package:freezed_annotation/freezed_annotation.dart';
part 'income_dto.freezed.dart';
part 'income_dto.g.dart';
@freezed
abstract class IncomeDto with _$IncomeDto {
const factory IncomeDto({
@required String id,
@required num amount,
}) = _IncomeDto;
factory IncomeDto.fromJson(Map<String, dynamic> json) =>
_$IncomeDtoFromJson(json);
factory IncomeDto.unknown(num amount) => IncomeDto(
id: '',
amount: amount,
);
}
Its giving this error
Could not generate
fromJson
code forcopyWith
.To support the type
_$IncomeDtoCopyWith
you can:JsonConverter
https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonConverter-class.html
JsonKey
fieldsfromJson
andtoJson
https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/fromJson.html
https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/toJson.html
package:Code_Generation/models/income_dto.freezed.dart:175:39
╷
175 │ _$IncomeDtoCopyWith<_IncomeDto> get copyWith =>
│ ^^^^^^^^
The text was updated successfully, but these errors were encountered: