diff --git a/packages/stream_chat/lib/src/core/models/attachment_file.freezed.dart b/packages/stream_chat/lib/src/core/models/attachment_file.freezed.dart index 6b7b00cf..c524a742 100644 --- a/packages/stream_chat/lib/src/core/models/attachment_file.freezed.dart +++ b/packages/stream_chat/lib/src/core/models/attachment_file.freezed.dart @@ -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 json) { - switch (json['type']) { + switch (json['runtimeType']) { case 'preparing': return Preparing.fromJson(json); case 'inProgress': @@ -25,8 +25,8 @@ UploadState _$UploadStateFromJson(Map 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 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 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 diff --git a/packages/stream_chat/lib/src/core/models/attachment_file.g.dart b/packages/stream_chat/lib/src/core/models/attachment_file.g.dart index 8324482d..6b657c2a 100644 --- a/packages/stream_chat/lib/src/core/models/attachment_file.g.dart +++ b/packages/stream_chat/lib/src/core/models/attachment_file.g.dart @@ -23,41 +23,41 @@ Map _$AttachmentFileToJson(AttachmentFile instance) => }; _$Preparing _$$PreparingFromJson(Map json) => _$Preparing( - $type: json['type'] as String?, + $type: json['runtimeType'] as String?, ); Map _$$PreparingToJson(_$Preparing instance) => { - 'type': instance.$type, + 'runtimeType': instance.$type, }; _$InProgress _$$InProgressFromJson(Map json) => _$InProgress( uploaded: json['uploaded'] as int, total: json['total'] as int, - $type: json['type'] as String?, + $type: json['runtimeType'] as String?, ); Map _$$InProgressToJson(_$InProgress instance) => { 'uploaded': instance.uploaded, 'total': instance.total, - 'type': instance.$type, + 'runtimeType': instance.$type, }; _$Success _$$SuccessFromJson(Map json) => _$Success( - $type: json['type'] as String?, + $type: json['runtimeType'] as String?, ); Map _$$SuccessToJson(_$Success instance) => { - 'type': instance.$type, + 'runtimeType': instance.$type, }; _$Failed _$$FailedFromJson(Map json) => _$Failed( error: json['error'] as String, - $type: json['type'] as String?, + $type: json['runtimeType'] as String?, ); Map _$$FailedToJson(_$Failed instance) => { 'error': instance.error, - 'type': instance.$type, + 'runtimeType': instance.$type, }; diff --git a/packages/stream_chat/pubspec.yaml b/packages/stream_chat/pubspec.yaml index ff8d5356..a723e77b 100644 --- a/packages/stream_chat/pubspec.yaml +++ b/packages/stream_chat/pubspec.yaml @@ -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 \ No newline at end of file