polish 4.0.0 and prepare 4.0.1

This commit is contained in:
Salvatore Giordano
2022-05-03 11:58:55 +02:00
parent 9c05625f9b
commit 41f2d55f70
8 changed files with 86 additions and 95 deletions
@@ -12,7 +12,7 @@ part of 'attachment_file.dart';
T _$identity<T>(T value) => value;
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 information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
UploadState _$UploadStateFromJson(Map<String, dynamic> json) {
switch (json['runtimeType']) {
@@ -31,39 +31,6 @@ UploadState _$UploadStateFromJson(Map<String, dynamic> json) {
}
}
/// @nodoc
class _$UploadStateTearOff {
const _$UploadStateTearOff();
Preparing preparing() {
return const Preparing();
}
InProgress inProgress({required int uploaded, required int total}) {
return InProgress(
uploaded: uploaded,
total: total,
);
}
Success success() {
return const Success();
}
Failed failed({required String error}) {
return Failed(
error: error,
);
}
UploadState fromJson(Map<String, Object?> json) {
return UploadState.fromJson(json);
}
}
/// @nodoc
const $UploadState = _$UploadStateTearOff();
/// @nodoc
mixin _$UploadState {
@optionalTypeArgs
@@ -154,7 +121,7 @@ class _$PreparingCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$Preparing implements Preparing {
const _$Preparing({String? $type}) : $type = $type ?? 'preparing';
const _$Preparing({final String? $type}) : $type = $type ?? 'preparing';
factory _$Preparing.fromJson(Map<String, dynamic> json) =>
_$$PreparingFromJson(json);
@@ -173,6 +140,7 @@ class _$Preparing implements Preparing {
(other.runtimeType == runtimeType && other is Preparing);
}
@JsonKey(ignore: true)
@override
int get hashCode => runtimeType.hashCode;
@@ -301,7 +269,7 @@ class _$InProgressCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
@JsonSerializable()
class _$InProgress implements InProgress {
const _$InProgress(
{required this.uploaded, required this.total, String? $type})
{required this.uploaded, required this.total, final String? $type})
: $type = $type ?? 'inProgress';
factory _$InProgress.fromJson(Map<String, dynamic> json) =>
@@ -329,6 +297,7 @@ class _$InProgress implements InProgress {
const DeepCollectionEquality().equals(other.total, total));
}
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType,
@@ -421,14 +390,14 @@ class _$InProgress implements InProgress {
}
abstract class InProgress implements UploadState {
const factory InProgress({required int uploaded, required int total}) =
_$InProgress;
const factory InProgress(
{required final int uploaded, required final int total}) = _$InProgress;
factory InProgress.fromJson(Map<String, dynamic> json) =
_$InProgress.fromJson;
int get uploaded;
int get total;
int get uploaded => throw _privateConstructorUsedError;
int get total => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$InProgressCopyWith<InProgress> get copyWith =>
throw _privateConstructorUsedError;
@@ -453,7 +422,7 @@ class _$SuccessCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$Success implements Success {
const _$Success({String? $type}) : $type = $type ?? 'success';
const _$Success({final String? $type}) : $type = $type ?? 'success';
factory _$Success.fromJson(Map<String, dynamic> json) =>
_$$SuccessFromJson(json);
@@ -472,6 +441,7 @@ class _$Success implements Success {
(other.runtimeType == runtimeType && other is Success);
}
@JsonKey(ignore: true)
@override
int get hashCode => runtimeType.hashCode;
@@ -593,7 +563,7 @@ class _$FailedCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$Failed implements Failed {
const _$Failed({required this.error, String? $type})
const _$Failed({required this.error, final String? $type})
: $type = $type ?? 'failed';
factory _$Failed.fromJson(Map<String, dynamic> json) =>
@@ -618,6 +588,7 @@ class _$Failed implements Failed {
const DeepCollectionEquality().equals(other.error, error));
}
@JsonKey(ignore: true)
@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(error));
@@ -708,11 +679,11 @@ class _$Failed implements Failed {
}
abstract class Failed implements UploadState {
const factory Failed({required String error}) = _$Failed;
const factory Failed({required final String error}) = _$Failed;
factory Failed.fromJson(Map<String, dynamic> json) = _$Failed.fromJson;
String get error;
String get error => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$FailedCopyWith<Failed> get copyWith => throw _privateConstructorUsedError;
}