fix models

This commit is contained in:
Salvatore Giordano
2021-11-26 10:47:48 +01:00
parent eb186a92fb
commit e9d148ef49
3 changed files with 17 additions and 17 deletions
@@ -14,7 +14,7 @@ final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
UploadState _$UploadStateFromJson(Map<String, dynamic> json) {
switch (json['type']) {
switch (json['runtimeType']) {
case 'preparing':
return Preparing.fromJson(json);
case 'inProgress':
@@ -25,8 +25,8 @@ UploadState _$UploadStateFromJson(Map<String, dynamic> json) {
return Failed.fromJson(json);
default:
throw CheckedFromJsonException(
json, 'type', 'UploadState', 'Invalid union type "${json['type']}"!');
throw CheckedFromJsonException(json, 'runtimeType', 'UploadState',
'Invalid union type "${json['runtimeType']}"!');
}
}
@@ -158,7 +158,7 @@ class _$Preparing implements Preparing {
factory _$Preparing.fromJson(Map<String, dynamic> json) =>
_$$PreparingFromJson(json);
@JsonKey(name: 'type')
@JsonKey(name: 'runtimeType')
final String $type;
@override
@@ -311,7 +311,7 @@ class _$InProgress implements InProgress {
@override
final int total;
@JsonKey(name: 'type')
@JsonKey(name: 'runtimeType')
final String $type;
@override
@@ -455,7 +455,7 @@ class _$Success implements Success {
factory _$Success.fromJson(Map<String, dynamic> json) =>
_$$SuccessFromJson(json);
@JsonKey(name: 'type')
@JsonKey(name: 'runtimeType')
final String $type;
@override
@@ -599,7 +599,7 @@ class _$Failed implements Failed {
@override
final String error;
@JsonKey(name: 'type')
@JsonKey(name: 'runtimeType')
final String $type;
@override
@@ -23,41 +23,41 @@ Map<String, dynamic> _$AttachmentFileToJson(AttachmentFile instance) =>
};
_$Preparing _$$PreparingFromJson(Map<String, dynamic> json) => _$Preparing(
$type: json['type'] as String?,
$type: json['runtimeType'] as String?,
);
Map<String, dynamic> _$$PreparingToJson(_$Preparing instance) =>
<String, dynamic>{
'type': instance.$type,
'runtimeType': instance.$type,
};
_$InProgress _$$InProgressFromJson(Map<String, dynamic> json) => _$InProgress(
uploaded: json['uploaded'] as int,
total: json['total'] as int,
$type: json['type'] as String?,
$type: json['runtimeType'] as String?,
);
Map<String, dynamic> _$$InProgressToJson(_$InProgress instance) =>
<String, dynamic>{
'uploaded': instance.uploaded,
'total': instance.total,
'type': instance.$type,
'runtimeType': instance.$type,
};
_$Success _$$SuccessFromJson(Map<String, dynamic> json) => _$Success(
$type: json['type'] as String?,
$type: json['runtimeType'] as String?,
);
Map<String, dynamic> _$$SuccessToJson(_$Success instance) => <String, dynamic>{
'type': instance.$type,
'runtimeType': instance.$type,
};
_$Failed _$$FailedFromJson(Map<String, dynamic> json) => _$Failed(
error: json['error'] as String,
$type: json['type'] as String?,
$type: json['runtimeType'] as String?,
);
Map<String, dynamic> _$$FailedToJson(_$Failed instance) => <String, dynamic>{
'error': instance.error,
'type': instance.$type,
'runtimeType': instance.$type,
};
+2 -2
View File
@@ -13,7 +13,7 @@ dependencies:
collection: ^1.15.0
dio: ^4.0.0
equatable: ^2.0.0
freezed_annotation: ^0.15.0
freezed_annotation: ^1.0.0
http_parser: ^4.0.0
jose: ^0.3.2
json_annotation: ^4.3.0
@@ -28,7 +28,7 @@ dependencies:
dev_dependencies:
build_runner: ^2.0.1
dart_code_metrics: ^4.4.0
freezed: ^0.15.0+1
freezed: ^1.0.0
json_serializable: ^6.0.1
mocktail: ^0.2.0
test: ^1.17.12