import 'package:json_annotation/json_annotation.dart'; import '_models.dart'; part 'sample.g.dart'; @JsonSerializable() class Sample { Sample({this.string, this.integer, this.decimal, this.boolean, this.date}); String? string; int? integer; double? decimal; bool? boolean; DateTime? date; @JsonKey(ignore: true) String? id; factory Sample.fromJson(Map json) => _$SampleFromJson(json); Map toJson() => _$SampleToJson(this); @override operator ==(Object other) => other is Sample && other.id == id; @override int get hashCode => id.hashCode; @override String toString() { return ''; } }