Skip to content
New issue

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

Not generating other factories when fromJson present #323

Closed
gullucktheapp opened this issue Dec 13, 2020 · 2 comments
Closed

Not generating other factories when fromJson present #323

gullucktheapp opened this issue Dec 13, 2020 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@gullucktheapp
Copy link

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:

@gullucktheapp gullucktheapp added bug Something isn't working needs triage labels Dec 13, 2020
@pratikpparikh
Copy link

@rrousselGit this is only a problem with 0.12.5. @gullucktheapp you might want to use 0.12.4 or lesser version

@rrousselGit
Copy link
Owner

This was fixed as part of 0.12.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

3 participants