You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Having an obj with a dynamic field, the copyWith is generated with no replacement with null like other fields
The Objs with other 2 examples field
// coverage:ignore-file
import 'package:freezed_annotation/freezed_annotation.dart';
part 'test_obj.freezed.dart';
part 'test_obj.g.dart';
@freezed
class TestObj with _$TestObj {
@JsonSerializable(fieldRename: FieldRename.snake)
const factory TestObj({
required String stringRequired,
String? stringNullable,
@Default('1') String stringWithDefault,
required int intRequired,
int? intNullable,
@Default(1) int intWithDefault,
required dynamic dynamicRequired,
dynamic? dynamicNullable,
@Default(null) dynamic dynamicWithDefault,
}) = _TestObj;
factory TestObj.fromJson(Map<String, dynamic> json) => _$TestObjFromJson(json);
}
Describe the bug
Having an obj with a dynamic field, the copyWith is generated with no replacement with null like other fields
The Objs with other 2 examples field
The copyWith generted
Expected behavior
the dynamic should be
considering that dynamic is already nullable
in consequence, if I want to reset the dynamic field with null is not resetting the field and returns the new object with the old value
The text was updated successfully, but these errors were encountered: