fix models
This commit is contained in:
@@ -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');
|
'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) {
|
UploadState _$UploadStateFromJson(Map<String, dynamic> json) {
|
||||||
switch (json['type']) {
|
switch (json['runtimeType']) {
|
||||||
case 'preparing':
|
case 'preparing':
|
||||||
return Preparing.fromJson(json);
|
return Preparing.fromJson(json);
|
||||||
case 'inProgress':
|
case 'inProgress':
|
||||||
@@ -25,8 +25,8 @@ UploadState _$UploadStateFromJson(Map<String, dynamic> json) {
|
|||||||
return Failed.fromJson(json);
|
return Failed.fromJson(json);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw CheckedFromJsonException(
|
throw CheckedFromJsonException(json, 'runtimeType', 'UploadState',
|
||||||
json, 'type', 'UploadState', 'Invalid union type "${json['type']}"!');
|
'Invalid union type "${json['runtimeType']}"!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ class _$Preparing implements Preparing {
|
|||||||
factory _$Preparing.fromJson(Map<String, dynamic> json) =>
|
factory _$Preparing.fromJson(Map<String, dynamic> json) =>
|
||||||
_$$PreparingFromJson(json);
|
_$$PreparingFromJson(json);
|
||||||
|
|
||||||
@JsonKey(name: 'type')
|
@JsonKey(name: 'runtimeType')
|
||||||
final String $type;
|
final String $type;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -311,7 +311,7 @@ class _$InProgress implements InProgress {
|
|||||||
@override
|
@override
|
||||||
final int total;
|
final int total;
|
||||||
|
|
||||||
@JsonKey(name: 'type')
|
@JsonKey(name: 'runtimeType')
|
||||||
final String $type;
|
final String $type;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -455,7 +455,7 @@ class _$Success implements Success {
|
|||||||
factory _$Success.fromJson(Map<String, dynamic> json) =>
|
factory _$Success.fromJson(Map<String, dynamic> json) =>
|
||||||
_$$SuccessFromJson(json);
|
_$$SuccessFromJson(json);
|
||||||
|
|
||||||
@JsonKey(name: 'type')
|
@JsonKey(name: 'runtimeType')
|
||||||
final String $type;
|
final String $type;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -599,7 +599,7 @@ class _$Failed implements Failed {
|
|||||||
@override
|
@override
|
||||||
final String error;
|
final String error;
|
||||||
|
|
||||||
@JsonKey(name: 'type')
|
@JsonKey(name: 'runtimeType')
|
||||||
final String $type;
|
final String $type;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -23,41 +23,41 @@ Map<String, dynamic> _$AttachmentFileToJson(AttachmentFile instance) =>
|
|||||||
};
|
};
|
||||||
|
|
||||||
_$Preparing _$$PreparingFromJson(Map<String, dynamic> json) => _$Preparing(
|
_$Preparing _$$PreparingFromJson(Map<String, dynamic> json) => _$Preparing(
|
||||||
$type: json['type'] as String?,
|
$type: json['runtimeType'] as String?,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$PreparingToJson(_$Preparing instance) =>
|
Map<String, dynamic> _$$PreparingToJson(_$Preparing instance) =>
|
||||||
<String, dynamic>{
|
<String, dynamic>{
|
||||||
'type': instance.$type,
|
'runtimeType': instance.$type,
|
||||||
};
|
};
|
||||||
|
|
||||||
_$InProgress _$$InProgressFromJson(Map<String, dynamic> json) => _$InProgress(
|
_$InProgress _$$InProgressFromJson(Map<String, dynamic> json) => _$InProgress(
|
||||||
uploaded: json['uploaded'] as int,
|
uploaded: json['uploaded'] as int,
|
||||||
total: json['total'] as int,
|
total: json['total'] as int,
|
||||||
$type: json['type'] as String?,
|
$type: json['runtimeType'] as String?,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$InProgressToJson(_$InProgress instance) =>
|
Map<String, dynamic> _$$InProgressToJson(_$InProgress instance) =>
|
||||||
<String, dynamic>{
|
<String, dynamic>{
|
||||||
'uploaded': instance.uploaded,
|
'uploaded': instance.uploaded,
|
||||||
'total': instance.total,
|
'total': instance.total,
|
||||||
'type': instance.$type,
|
'runtimeType': instance.$type,
|
||||||
};
|
};
|
||||||
|
|
||||||
_$Success _$$SuccessFromJson(Map<String, dynamic> json) => _$Success(
|
_$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>{
|
Map<String, dynamic> _$$SuccessToJson(_$Success instance) => <String, dynamic>{
|
||||||
'type': instance.$type,
|
'runtimeType': instance.$type,
|
||||||
};
|
};
|
||||||
|
|
||||||
_$Failed _$$FailedFromJson(Map<String, dynamic> json) => _$Failed(
|
_$Failed _$$FailedFromJson(Map<String, dynamic> json) => _$Failed(
|
||||||
error: json['error'] as String,
|
error: json['error'] as String,
|
||||||
$type: json['type'] as String?,
|
$type: json['runtimeType'] as String?,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$FailedToJson(_$Failed instance) => <String, dynamic>{
|
Map<String, dynamic> _$$FailedToJson(_$Failed instance) => <String, dynamic>{
|
||||||
'error': instance.error,
|
'error': instance.error,
|
||||||
'type': instance.$type,
|
'runtimeType': instance.$type,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ dependencies:
|
|||||||
collection: ^1.15.0
|
collection: ^1.15.0
|
||||||
dio: ^4.0.0
|
dio: ^4.0.0
|
||||||
equatable: ^2.0.0
|
equatable: ^2.0.0
|
||||||
freezed_annotation: ^0.15.0
|
freezed_annotation: ^1.0.0
|
||||||
http_parser: ^4.0.0
|
http_parser: ^4.0.0
|
||||||
jose: ^0.3.2
|
jose: ^0.3.2
|
||||||
json_annotation: ^4.3.0
|
json_annotation: ^4.3.0
|
||||||
@@ -28,7 +28,7 @@ dependencies:
|
|||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
build_runner: ^2.0.1
|
build_runner: ^2.0.1
|
||||||
dart_code_metrics: ^4.4.0
|
dart_code_metrics: ^4.4.0
|
||||||
freezed: ^0.15.0+1
|
freezed: ^1.0.0
|
||||||
json_serializable: ^6.0.1
|
json_serializable: ^6.0.1
|
||||||
mocktail: ^0.2.0
|
mocktail: ^0.2.0
|
||||||
test: ^1.17.12
|
test: ^1.17.12
|
||||||
Reference in New Issue
Block a user