Настройки, авторизация
This commit is contained in:
@@ -11,5 +11,6 @@ class AppError with _$AppError {
|
||||
const factory AppError.notFound({String? message}) = NotFoundError;
|
||||
const factory AppError.server({int? statusCode, String? message}) = ServerError;
|
||||
const factory AppError.database({String? message}) = DatabaseError;
|
||||
const factory AppError.validation({Map<String, String>? fieldErrors}) = ValidationError;
|
||||
const factory AppError.validation({String? message, Map<String, String>? fieldErrors}) = ValidationError;
|
||||
const factory AppError.parsing({String? message}) = ParsingError;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ final _privateConstructorUsedError = UnsupportedError(
|
||||
|
||||
/// @nodoc
|
||||
mixin _$AppError {
|
||||
String? get message => throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(String? message) unknown,
|
||||
@@ -25,7 +26,9 @@ mixin _$AppError {
|
||||
required TResult Function(String? message) notFound,
|
||||
required TResult Function(int? statusCode, String? message) server,
|
||||
required TResult Function(String? message) database,
|
||||
required TResult Function(Map<String, String>? fieldErrors) validation,
|
||||
required TResult Function(String? message, Map<String, String>? fieldErrors)
|
||||
validation,
|
||||
required TResult Function(String? message) parsing,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
@@ -37,7 +40,9 @@ mixin _$AppError {
|
||||
TResult? Function(String? message)? notFound,
|
||||
TResult? Function(int? statusCode, String? message)? server,
|
||||
TResult? Function(String? message)? database,
|
||||
TResult? Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult? Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult? Function(String? message)? parsing,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
@@ -49,7 +54,9 @@ mixin _$AppError {
|
||||
TResult Function(String? message)? notFound,
|
||||
TResult Function(int? statusCode, String? message)? server,
|
||||
TResult Function(String? message)? database,
|
||||
TResult Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult Function(String? message)? parsing,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@@ -63,6 +70,7 @@ mixin _$AppError {
|
||||
required TResult Function(ServerError value) server,
|
||||
required TResult Function(DatabaseError value) database,
|
||||
required TResult Function(ValidationError value) validation,
|
||||
required TResult Function(ParsingError value) parsing,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
@@ -75,6 +83,7 @@ mixin _$AppError {
|
||||
TResult? Function(ServerError value)? server,
|
||||
TResult? Function(DatabaseError value)? database,
|
||||
TResult? Function(ValidationError value)? validation,
|
||||
TResult? Function(ParsingError value)? parsing,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
@@ -87,15 +96,22 @@ mixin _$AppError {
|
||||
TResult Function(ServerError value)? server,
|
||||
TResult Function(DatabaseError value)? database,
|
||||
TResult Function(ValidationError value)? validation,
|
||||
TResult Function(ParsingError value)? parsing,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
$AppErrorCopyWith<AppError> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $AppErrorCopyWith<$Res> {
|
||||
factory $AppErrorCopyWith(AppError value, $Res Function(AppError) then) =
|
||||
_$AppErrorCopyWithImpl<$Res, AppError>;
|
||||
@useResult
|
||||
$Res call({String? message});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -107,13 +123,28 @@ class _$AppErrorCopyWithImpl<$Res, $Val extends AppError>
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
message: freezed == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$UnknownErrorImplCopyWith<$Res> {
|
||||
abstract class _$$UnknownErrorImplCopyWith<$Res>
|
||||
implements $AppErrorCopyWith<$Res> {
|
||||
factory _$$UnknownErrorImplCopyWith(
|
||||
_$UnknownErrorImpl value, $Res Function(_$UnknownErrorImpl) then) =
|
||||
__$$UnknownErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String? message});
|
||||
}
|
||||
@@ -180,7 +211,9 @@ class _$UnknownErrorImpl implements UnknownError {
|
||||
required TResult Function(String? message) notFound,
|
||||
required TResult Function(int? statusCode, String? message) server,
|
||||
required TResult Function(String? message) database,
|
||||
required TResult Function(Map<String, String>? fieldErrors) validation,
|
||||
required TResult Function(String? message, Map<String, String>? fieldErrors)
|
||||
validation,
|
||||
required TResult Function(String? message) parsing,
|
||||
}) {
|
||||
return unknown(message);
|
||||
}
|
||||
@@ -195,7 +228,9 @@ class _$UnknownErrorImpl implements UnknownError {
|
||||
TResult? Function(String? message)? notFound,
|
||||
TResult? Function(int? statusCode, String? message)? server,
|
||||
TResult? Function(String? message)? database,
|
||||
TResult? Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult? Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult? Function(String? message)? parsing,
|
||||
}) {
|
||||
return unknown?.call(message);
|
||||
}
|
||||
@@ -210,7 +245,9 @@ class _$UnknownErrorImpl implements UnknownError {
|
||||
TResult Function(String? message)? notFound,
|
||||
TResult Function(int? statusCode, String? message)? server,
|
||||
TResult Function(String? message)? database,
|
||||
TResult Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult Function(String? message)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (unknown != null) {
|
||||
@@ -230,6 +267,7 @@ class _$UnknownErrorImpl implements UnknownError {
|
||||
required TResult Function(ServerError value) server,
|
||||
required TResult Function(DatabaseError value) database,
|
||||
required TResult Function(ValidationError value) validation,
|
||||
required TResult Function(ParsingError value) parsing,
|
||||
}) {
|
||||
return unknown(this);
|
||||
}
|
||||
@@ -245,6 +283,7 @@ class _$UnknownErrorImpl implements UnknownError {
|
||||
TResult? Function(ServerError value)? server,
|
||||
TResult? Function(DatabaseError value)? database,
|
||||
TResult? Function(ValidationError value)? validation,
|
||||
TResult? Function(ParsingError value)? parsing,
|
||||
}) {
|
||||
return unknown?.call(this);
|
||||
}
|
||||
@@ -260,6 +299,7 @@ class _$UnknownErrorImpl implements UnknownError {
|
||||
TResult Function(ServerError value)? server,
|
||||
TResult Function(DatabaseError value)? database,
|
||||
TResult Function(ValidationError value)? validation,
|
||||
TResult Function(ParsingError value)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (unknown != null) {
|
||||
@@ -272,17 +312,21 @@ class _$UnknownErrorImpl implements UnknownError {
|
||||
abstract class UnknownError implements AppError {
|
||||
const factory UnknownError({final String? message}) = _$UnknownErrorImpl;
|
||||
|
||||
@override
|
||||
String? get message;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$UnknownErrorImplCopyWith<_$UnknownErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NetworkErrorImplCopyWith<$Res> {
|
||||
abstract class _$$NetworkErrorImplCopyWith<$Res>
|
||||
implements $AppErrorCopyWith<$Res> {
|
||||
factory _$$NetworkErrorImplCopyWith(
|
||||
_$NetworkErrorImpl value, $Res Function(_$NetworkErrorImpl) then) =
|
||||
__$$NetworkErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String? message});
|
||||
}
|
||||
@@ -349,7 +393,9 @@ class _$NetworkErrorImpl implements NetworkError {
|
||||
required TResult Function(String? message) notFound,
|
||||
required TResult Function(int? statusCode, String? message) server,
|
||||
required TResult Function(String? message) database,
|
||||
required TResult Function(Map<String, String>? fieldErrors) validation,
|
||||
required TResult Function(String? message, Map<String, String>? fieldErrors)
|
||||
validation,
|
||||
required TResult Function(String? message) parsing,
|
||||
}) {
|
||||
return network(message);
|
||||
}
|
||||
@@ -364,7 +410,9 @@ class _$NetworkErrorImpl implements NetworkError {
|
||||
TResult? Function(String? message)? notFound,
|
||||
TResult? Function(int? statusCode, String? message)? server,
|
||||
TResult? Function(String? message)? database,
|
||||
TResult? Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult? Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult? Function(String? message)? parsing,
|
||||
}) {
|
||||
return network?.call(message);
|
||||
}
|
||||
@@ -379,7 +427,9 @@ class _$NetworkErrorImpl implements NetworkError {
|
||||
TResult Function(String? message)? notFound,
|
||||
TResult Function(int? statusCode, String? message)? server,
|
||||
TResult Function(String? message)? database,
|
||||
TResult Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult Function(String? message)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (network != null) {
|
||||
@@ -399,6 +449,7 @@ class _$NetworkErrorImpl implements NetworkError {
|
||||
required TResult Function(ServerError value) server,
|
||||
required TResult Function(DatabaseError value) database,
|
||||
required TResult Function(ValidationError value) validation,
|
||||
required TResult Function(ParsingError value) parsing,
|
||||
}) {
|
||||
return network(this);
|
||||
}
|
||||
@@ -414,6 +465,7 @@ class _$NetworkErrorImpl implements NetworkError {
|
||||
TResult? Function(ServerError value)? server,
|
||||
TResult? Function(DatabaseError value)? database,
|
||||
TResult? Function(ValidationError value)? validation,
|
||||
TResult? Function(ParsingError value)? parsing,
|
||||
}) {
|
||||
return network?.call(this);
|
||||
}
|
||||
@@ -429,6 +481,7 @@ class _$NetworkErrorImpl implements NetworkError {
|
||||
TResult Function(ServerError value)? server,
|
||||
TResult Function(DatabaseError value)? database,
|
||||
TResult Function(ValidationError value)? validation,
|
||||
TResult Function(ParsingError value)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (network != null) {
|
||||
@@ -441,17 +494,21 @@ class _$NetworkErrorImpl implements NetworkError {
|
||||
abstract class NetworkError implements AppError {
|
||||
const factory NetworkError({final String? message}) = _$NetworkErrorImpl;
|
||||
|
||||
@override
|
||||
String? get message;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$NetworkErrorImplCopyWith<_$NetworkErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$UnauthorizedErrorImplCopyWith<$Res> {
|
||||
abstract class _$$UnauthorizedErrorImplCopyWith<$Res>
|
||||
implements $AppErrorCopyWith<$Res> {
|
||||
factory _$$UnauthorizedErrorImplCopyWith(_$UnauthorizedErrorImpl value,
|
||||
$Res Function(_$UnauthorizedErrorImpl) then) =
|
||||
__$$UnauthorizedErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String? message});
|
||||
}
|
||||
@@ -519,7 +576,9 @@ class _$UnauthorizedErrorImpl implements UnauthorizedError {
|
||||
required TResult Function(String? message) notFound,
|
||||
required TResult Function(int? statusCode, String? message) server,
|
||||
required TResult Function(String? message) database,
|
||||
required TResult Function(Map<String, String>? fieldErrors) validation,
|
||||
required TResult Function(String? message, Map<String, String>? fieldErrors)
|
||||
validation,
|
||||
required TResult Function(String? message) parsing,
|
||||
}) {
|
||||
return unauthorized(message);
|
||||
}
|
||||
@@ -534,7 +593,9 @@ class _$UnauthorizedErrorImpl implements UnauthorizedError {
|
||||
TResult? Function(String? message)? notFound,
|
||||
TResult? Function(int? statusCode, String? message)? server,
|
||||
TResult? Function(String? message)? database,
|
||||
TResult? Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult? Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult? Function(String? message)? parsing,
|
||||
}) {
|
||||
return unauthorized?.call(message);
|
||||
}
|
||||
@@ -549,7 +610,9 @@ class _$UnauthorizedErrorImpl implements UnauthorizedError {
|
||||
TResult Function(String? message)? notFound,
|
||||
TResult Function(int? statusCode, String? message)? server,
|
||||
TResult Function(String? message)? database,
|
||||
TResult Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult Function(String? message)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (unauthorized != null) {
|
||||
@@ -569,6 +632,7 @@ class _$UnauthorizedErrorImpl implements UnauthorizedError {
|
||||
required TResult Function(ServerError value) server,
|
||||
required TResult Function(DatabaseError value) database,
|
||||
required TResult Function(ValidationError value) validation,
|
||||
required TResult Function(ParsingError value) parsing,
|
||||
}) {
|
||||
return unauthorized(this);
|
||||
}
|
||||
@@ -584,6 +648,7 @@ class _$UnauthorizedErrorImpl implements UnauthorizedError {
|
||||
TResult? Function(ServerError value)? server,
|
||||
TResult? Function(DatabaseError value)? database,
|
||||
TResult? Function(ValidationError value)? validation,
|
||||
TResult? Function(ParsingError value)? parsing,
|
||||
}) {
|
||||
return unauthorized?.call(this);
|
||||
}
|
||||
@@ -599,6 +664,7 @@ class _$UnauthorizedErrorImpl implements UnauthorizedError {
|
||||
TResult Function(ServerError value)? server,
|
||||
TResult Function(DatabaseError value)? database,
|
||||
TResult Function(ValidationError value)? validation,
|
||||
TResult Function(ParsingError value)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (unauthorized != null) {
|
||||
@@ -612,17 +678,21 @@ abstract class UnauthorizedError implements AppError {
|
||||
const factory UnauthorizedError({final String? message}) =
|
||||
_$UnauthorizedErrorImpl;
|
||||
|
||||
@override
|
||||
String? get message;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$UnauthorizedErrorImplCopyWith<_$UnauthorizedErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ForbiddenErrorImplCopyWith<$Res> {
|
||||
abstract class _$$ForbiddenErrorImplCopyWith<$Res>
|
||||
implements $AppErrorCopyWith<$Res> {
|
||||
factory _$$ForbiddenErrorImplCopyWith(_$ForbiddenErrorImpl value,
|
||||
$Res Function(_$ForbiddenErrorImpl) then) =
|
||||
__$$ForbiddenErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String? message});
|
||||
}
|
||||
@@ -690,7 +760,9 @@ class _$ForbiddenErrorImpl implements ForbiddenError {
|
||||
required TResult Function(String? message) notFound,
|
||||
required TResult Function(int? statusCode, String? message) server,
|
||||
required TResult Function(String? message) database,
|
||||
required TResult Function(Map<String, String>? fieldErrors) validation,
|
||||
required TResult Function(String? message, Map<String, String>? fieldErrors)
|
||||
validation,
|
||||
required TResult Function(String? message) parsing,
|
||||
}) {
|
||||
return forbidden(message);
|
||||
}
|
||||
@@ -705,7 +777,9 @@ class _$ForbiddenErrorImpl implements ForbiddenError {
|
||||
TResult? Function(String? message)? notFound,
|
||||
TResult? Function(int? statusCode, String? message)? server,
|
||||
TResult? Function(String? message)? database,
|
||||
TResult? Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult? Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult? Function(String? message)? parsing,
|
||||
}) {
|
||||
return forbidden?.call(message);
|
||||
}
|
||||
@@ -720,7 +794,9 @@ class _$ForbiddenErrorImpl implements ForbiddenError {
|
||||
TResult Function(String? message)? notFound,
|
||||
TResult Function(int? statusCode, String? message)? server,
|
||||
TResult Function(String? message)? database,
|
||||
TResult Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult Function(String? message)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (forbidden != null) {
|
||||
@@ -740,6 +816,7 @@ class _$ForbiddenErrorImpl implements ForbiddenError {
|
||||
required TResult Function(ServerError value) server,
|
||||
required TResult Function(DatabaseError value) database,
|
||||
required TResult Function(ValidationError value) validation,
|
||||
required TResult Function(ParsingError value) parsing,
|
||||
}) {
|
||||
return forbidden(this);
|
||||
}
|
||||
@@ -755,6 +832,7 @@ class _$ForbiddenErrorImpl implements ForbiddenError {
|
||||
TResult? Function(ServerError value)? server,
|
||||
TResult? Function(DatabaseError value)? database,
|
||||
TResult? Function(ValidationError value)? validation,
|
||||
TResult? Function(ParsingError value)? parsing,
|
||||
}) {
|
||||
return forbidden?.call(this);
|
||||
}
|
||||
@@ -770,6 +848,7 @@ class _$ForbiddenErrorImpl implements ForbiddenError {
|
||||
TResult Function(ServerError value)? server,
|
||||
TResult Function(DatabaseError value)? database,
|
||||
TResult Function(ValidationError value)? validation,
|
||||
TResult Function(ParsingError value)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (forbidden != null) {
|
||||
@@ -782,17 +861,21 @@ class _$ForbiddenErrorImpl implements ForbiddenError {
|
||||
abstract class ForbiddenError implements AppError {
|
||||
const factory ForbiddenError({final String? message}) = _$ForbiddenErrorImpl;
|
||||
|
||||
@override
|
||||
String? get message;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$ForbiddenErrorImplCopyWith<_$ForbiddenErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NotFoundErrorImplCopyWith<$Res> {
|
||||
abstract class _$$NotFoundErrorImplCopyWith<$Res>
|
||||
implements $AppErrorCopyWith<$Res> {
|
||||
factory _$$NotFoundErrorImplCopyWith(
|
||||
_$NotFoundErrorImpl value, $Res Function(_$NotFoundErrorImpl) then) =
|
||||
__$$NotFoundErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String? message});
|
||||
}
|
||||
@@ -859,7 +942,9 @@ class _$NotFoundErrorImpl implements NotFoundError {
|
||||
required TResult Function(String? message) notFound,
|
||||
required TResult Function(int? statusCode, String? message) server,
|
||||
required TResult Function(String? message) database,
|
||||
required TResult Function(Map<String, String>? fieldErrors) validation,
|
||||
required TResult Function(String? message, Map<String, String>? fieldErrors)
|
||||
validation,
|
||||
required TResult Function(String? message) parsing,
|
||||
}) {
|
||||
return notFound(message);
|
||||
}
|
||||
@@ -874,7 +959,9 @@ class _$NotFoundErrorImpl implements NotFoundError {
|
||||
TResult? Function(String? message)? notFound,
|
||||
TResult? Function(int? statusCode, String? message)? server,
|
||||
TResult? Function(String? message)? database,
|
||||
TResult? Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult? Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult? Function(String? message)? parsing,
|
||||
}) {
|
||||
return notFound?.call(message);
|
||||
}
|
||||
@@ -889,7 +976,9 @@ class _$NotFoundErrorImpl implements NotFoundError {
|
||||
TResult Function(String? message)? notFound,
|
||||
TResult Function(int? statusCode, String? message)? server,
|
||||
TResult Function(String? message)? database,
|
||||
TResult Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult Function(String? message)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (notFound != null) {
|
||||
@@ -909,6 +998,7 @@ class _$NotFoundErrorImpl implements NotFoundError {
|
||||
required TResult Function(ServerError value) server,
|
||||
required TResult Function(DatabaseError value) database,
|
||||
required TResult Function(ValidationError value) validation,
|
||||
required TResult Function(ParsingError value) parsing,
|
||||
}) {
|
||||
return notFound(this);
|
||||
}
|
||||
@@ -924,6 +1014,7 @@ class _$NotFoundErrorImpl implements NotFoundError {
|
||||
TResult? Function(ServerError value)? server,
|
||||
TResult? Function(DatabaseError value)? database,
|
||||
TResult? Function(ValidationError value)? validation,
|
||||
TResult? Function(ParsingError value)? parsing,
|
||||
}) {
|
||||
return notFound?.call(this);
|
||||
}
|
||||
@@ -939,6 +1030,7 @@ class _$NotFoundErrorImpl implements NotFoundError {
|
||||
TResult Function(ServerError value)? server,
|
||||
TResult Function(DatabaseError value)? database,
|
||||
TResult Function(ValidationError value)? validation,
|
||||
TResult Function(ParsingError value)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (notFound != null) {
|
||||
@@ -951,17 +1043,21 @@ class _$NotFoundErrorImpl implements NotFoundError {
|
||||
abstract class NotFoundError implements AppError {
|
||||
const factory NotFoundError({final String? message}) = _$NotFoundErrorImpl;
|
||||
|
||||
@override
|
||||
String? get message;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$NotFoundErrorImplCopyWith<_$NotFoundErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ServerErrorImplCopyWith<$Res> {
|
||||
abstract class _$$ServerErrorImplCopyWith<$Res>
|
||||
implements $AppErrorCopyWith<$Res> {
|
||||
factory _$$ServerErrorImplCopyWith(
|
||||
_$ServerErrorImpl value, $Res Function(_$ServerErrorImpl) then) =
|
||||
__$$ServerErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int? statusCode, String? message});
|
||||
}
|
||||
@@ -1037,7 +1133,9 @@ class _$ServerErrorImpl implements ServerError {
|
||||
required TResult Function(String? message) notFound,
|
||||
required TResult Function(int? statusCode, String? message) server,
|
||||
required TResult Function(String? message) database,
|
||||
required TResult Function(Map<String, String>? fieldErrors) validation,
|
||||
required TResult Function(String? message, Map<String, String>? fieldErrors)
|
||||
validation,
|
||||
required TResult Function(String? message) parsing,
|
||||
}) {
|
||||
return server(statusCode, message);
|
||||
}
|
||||
@@ -1052,7 +1150,9 @@ class _$ServerErrorImpl implements ServerError {
|
||||
TResult? Function(String? message)? notFound,
|
||||
TResult? Function(int? statusCode, String? message)? server,
|
||||
TResult? Function(String? message)? database,
|
||||
TResult? Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult? Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult? Function(String? message)? parsing,
|
||||
}) {
|
||||
return server?.call(statusCode, message);
|
||||
}
|
||||
@@ -1067,7 +1167,9 @@ class _$ServerErrorImpl implements ServerError {
|
||||
TResult Function(String? message)? notFound,
|
||||
TResult Function(int? statusCode, String? message)? server,
|
||||
TResult Function(String? message)? database,
|
||||
TResult Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult Function(String? message)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (server != null) {
|
||||
@@ -1087,6 +1189,7 @@ class _$ServerErrorImpl implements ServerError {
|
||||
required TResult Function(ServerError value) server,
|
||||
required TResult Function(DatabaseError value) database,
|
||||
required TResult Function(ValidationError value) validation,
|
||||
required TResult Function(ParsingError value) parsing,
|
||||
}) {
|
||||
return server(this);
|
||||
}
|
||||
@@ -1102,6 +1205,7 @@ class _$ServerErrorImpl implements ServerError {
|
||||
TResult? Function(ServerError value)? server,
|
||||
TResult? Function(DatabaseError value)? database,
|
||||
TResult? Function(ValidationError value)? validation,
|
||||
TResult? Function(ParsingError value)? parsing,
|
||||
}) {
|
||||
return server?.call(this);
|
||||
}
|
||||
@@ -1117,6 +1221,7 @@ class _$ServerErrorImpl implements ServerError {
|
||||
TResult Function(ServerError value)? server,
|
||||
TResult Function(DatabaseError value)? database,
|
||||
TResult Function(ValidationError value)? validation,
|
||||
TResult Function(ParsingError value)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (server != null) {
|
||||
@@ -1131,17 +1236,21 @@ abstract class ServerError implements AppError {
|
||||
_$ServerErrorImpl;
|
||||
|
||||
int? get statusCode;
|
||||
@override
|
||||
String? get message;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$ServerErrorImplCopyWith<_$ServerErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DatabaseErrorImplCopyWith<$Res> {
|
||||
abstract class _$$DatabaseErrorImplCopyWith<$Res>
|
||||
implements $AppErrorCopyWith<$Res> {
|
||||
factory _$$DatabaseErrorImplCopyWith(
|
||||
_$DatabaseErrorImpl value, $Res Function(_$DatabaseErrorImpl) then) =
|
||||
__$$DatabaseErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String? message});
|
||||
}
|
||||
@@ -1208,7 +1317,9 @@ class _$DatabaseErrorImpl implements DatabaseError {
|
||||
required TResult Function(String? message) notFound,
|
||||
required TResult Function(int? statusCode, String? message) server,
|
||||
required TResult Function(String? message) database,
|
||||
required TResult Function(Map<String, String>? fieldErrors) validation,
|
||||
required TResult Function(String? message, Map<String, String>? fieldErrors)
|
||||
validation,
|
||||
required TResult Function(String? message) parsing,
|
||||
}) {
|
||||
return database(message);
|
||||
}
|
||||
@@ -1223,7 +1334,9 @@ class _$DatabaseErrorImpl implements DatabaseError {
|
||||
TResult? Function(String? message)? notFound,
|
||||
TResult? Function(int? statusCode, String? message)? server,
|
||||
TResult? Function(String? message)? database,
|
||||
TResult? Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult? Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult? Function(String? message)? parsing,
|
||||
}) {
|
||||
return database?.call(message);
|
||||
}
|
||||
@@ -1238,7 +1351,9 @@ class _$DatabaseErrorImpl implements DatabaseError {
|
||||
TResult Function(String? message)? notFound,
|
||||
TResult Function(int? statusCode, String? message)? server,
|
||||
TResult Function(String? message)? database,
|
||||
TResult Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult Function(String? message)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (database != null) {
|
||||
@@ -1258,6 +1373,7 @@ class _$DatabaseErrorImpl implements DatabaseError {
|
||||
required TResult Function(ServerError value) server,
|
||||
required TResult Function(DatabaseError value) database,
|
||||
required TResult Function(ValidationError value) validation,
|
||||
required TResult Function(ParsingError value) parsing,
|
||||
}) {
|
||||
return database(this);
|
||||
}
|
||||
@@ -1273,6 +1389,7 @@ class _$DatabaseErrorImpl implements DatabaseError {
|
||||
TResult? Function(ServerError value)? server,
|
||||
TResult? Function(DatabaseError value)? database,
|
||||
TResult? Function(ValidationError value)? validation,
|
||||
TResult? Function(ParsingError value)? parsing,
|
||||
}) {
|
||||
return database?.call(this);
|
||||
}
|
||||
@@ -1288,6 +1405,7 @@ class _$DatabaseErrorImpl implements DatabaseError {
|
||||
TResult Function(ServerError value)? server,
|
||||
TResult Function(DatabaseError value)? database,
|
||||
TResult Function(ValidationError value)? validation,
|
||||
TResult Function(ParsingError value)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (database != null) {
|
||||
@@ -1300,19 +1418,23 @@ class _$DatabaseErrorImpl implements DatabaseError {
|
||||
abstract class DatabaseError implements AppError {
|
||||
const factory DatabaseError({final String? message}) = _$DatabaseErrorImpl;
|
||||
|
||||
@override
|
||||
String? get message;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$DatabaseErrorImplCopyWith<_$DatabaseErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ValidationErrorImplCopyWith<$Res> {
|
||||
abstract class _$$ValidationErrorImplCopyWith<$Res>
|
||||
implements $AppErrorCopyWith<$Res> {
|
||||
factory _$$ValidationErrorImplCopyWith(_$ValidationErrorImpl value,
|
||||
$Res Function(_$ValidationErrorImpl) then) =
|
||||
__$$ValidationErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({Map<String, String>? fieldErrors});
|
||||
$Res call({String? message, Map<String, String>? fieldErrors});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1326,9 +1448,14 @@ class __$$ValidationErrorImplCopyWithImpl<$Res>
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = freezed,
|
||||
Object? fieldErrors = freezed,
|
||||
}) {
|
||||
return _then(_$ValidationErrorImpl(
|
||||
message: freezed == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
fieldErrors: freezed == fieldErrors
|
||||
? _value._fieldErrors
|
||||
: fieldErrors // ignore: cast_nullable_to_non_nullable
|
||||
@@ -1340,9 +1467,12 @@ class __$$ValidationErrorImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
|
||||
class _$ValidationErrorImpl implements ValidationError {
|
||||
const _$ValidationErrorImpl({final Map<String, String>? fieldErrors})
|
||||
const _$ValidationErrorImpl(
|
||||
{this.message, final Map<String, String>? fieldErrors})
|
||||
: _fieldErrors = fieldErrors;
|
||||
|
||||
@override
|
||||
final String? message;
|
||||
final Map<String, String>? _fieldErrors;
|
||||
@override
|
||||
Map<String, String>? get fieldErrors {
|
||||
@@ -1355,7 +1485,7 @@ class _$ValidationErrorImpl implements ValidationError {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AppError.validation(fieldErrors: $fieldErrors)';
|
||||
return 'AppError.validation(message: $message, fieldErrors: $fieldErrors)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1363,13 +1493,14 @@ class _$ValidationErrorImpl implements ValidationError {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ValidationErrorImpl &&
|
||||
(identical(other.message, message) || other.message == message) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._fieldErrors, _fieldErrors));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_fieldErrors));
|
||||
runtimeType, message, const DeepCollectionEquality().hash(_fieldErrors));
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@@ -1388,9 +1519,11 @@ class _$ValidationErrorImpl implements ValidationError {
|
||||
required TResult Function(String? message) notFound,
|
||||
required TResult Function(int? statusCode, String? message) server,
|
||||
required TResult Function(String? message) database,
|
||||
required TResult Function(Map<String, String>? fieldErrors) validation,
|
||||
required TResult Function(String? message, Map<String, String>? fieldErrors)
|
||||
validation,
|
||||
required TResult Function(String? message) parsing,
|
||||
}) {
|
||||
return validation(fieldErrors);
|
||||
return validation(message, fieldErrors);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1403,9 +1536,11 @@ class _$ValidationErrorImpl implements ValidationError {
|
||||
TResult? Function(String? message)? notFound,
|
||||
TResult? Function(int? statusCode, String? message)? server,
|
||||
TResult? Function(String? message)? database,
|
||||
TResult? Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult? Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult? Function(String? message)? parsing,
|
||||
}) {
|
||||
return validation?.call(fieldErrors);
|
||||
return validation?.call(message, fieldErrors);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1418,11 +1553,13 @@ class _$ValidationErrorImpl implements ValidationError {
|
||||
TResult Function(String? message)? notFound,
|
||||
TResult Function(int? statusCode, String? message)? server,
|
||||
TResult Function(String? message)? database,
|
||||
TResult Function(Map<String, String>? fieldErrors)? validation,
|
||||
TResult Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult Function(String? message)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (validation != null) {
|
||||
return validation(fieldErrors);
|
||||
return validation(message, fieldErrors);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
@@ -1438,6 +1575,7 @@ class _$ValidationErrorImpl implements ValidationError {
|
||||
required TResult Function(ServerError value) server,
|
||||
required TResult Function(DatabaseError value) database,
|
||||
required TResult Function(ValidationError value) validation,
|
||||
required TResult Function(ParsingError value) parsing,
|
||||
}) {
|
||||
return validation(this);
|
||||
}
|
||||
@@ -1453,6 +1591,7 @@ class _$ValidationErrorImpl implements ValidationError {
|
||||
TResult? Function(ServerError value)? server,
|
||||
TResult? Function(DatabaseError value)? database,
|
||||
TResult? Function(ValidationError value)? validation,
|
||||
TResult? Function(ParsingError value)? parsing,
|
||||
}) {
|
||||
return validation?.call(this);
|
||||
}
|
||||
@@ -1468,6 +1607,7 @@ class _$ValidationErrorImpl implements ValidationError {
|
||||
TResult Function(ServerError value)? server,
|
||||
TResult Function(DatabaseError value)? database,
|
||||
TResult Function(ValidationError value)? validation,
|
||||
TResult Function(ParsingError value)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (validation != null) {
|
||||
@@ -1478,11 +1618,197 @@ class _$ValidationErrorImpl implements ValidationError {
|
||||
}
|
||||
|
||||
abstract class ValidationError implements AppError {
|
||||
const factory ValidationError({final Map<String, String>? fieldErrors}) =
|
||||
_$ValidationErrorImpl;
|
||||
const factory ValidationError(
|
||||
{final String? message,
|
||||
final Map<String, String>? fieldErrors}) = _$ValidationErrorImpl;
|
||||
|
||||
@override
|
||||
String? get message;
|
||||
Map<String, String>? get fieldErrors;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$ValidationErrorImplCopyWith<_$ValidationErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ParsingErrorImplCopyWith<$Res>
|
||||
implements $AppErrorCopyWith<$Res> {
|
||||
factory _$$ParsingErrorImplCopyWith(
|
||||
_$ParsingErrorImpl value, $Res Function(_$ParsingErrorImpl) then) =
|
||||
__$$ParsingErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String? message});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ParsingErrorImplCopyWithImpl<$Res>
|
||||
extends _$AppErrorCopyWithImpl<$Res, _$ParsingErrorImpl>
|
||||
implements _$$ParsingErrorImplCopyWith<$Res> {
|
||||
__$$ParsingErrorImplCopyWithImpl(
|
||||
_$ParsingErrorImpl _value, $Res Function(_$ParsingErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = freezed,
|
||||
}) {
|
||||
return _then(_$ParsingErrorImpl(
|
||||
message: freezed == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ParsingErrorImpl implements ParsingError {
|
||||
const _$ParsingErrorImpl({this.message});
|
||||
|
||||
@override
|
||||
final String? message;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AppError.parsing(message: $message)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ParsingErrorImpl &&
|
||||
(identical(other.message, message) || other.message == message));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, message);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ParsingErrorImplCopyWith<_$ParsingErrorImpl> get copyWith =>
|
||||
__$$ParsingErrorImplCopyWithImpl<_$ParsingErrorImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(String? message) unknown,
|
||||
required TResult Function(String? message) network,
|
||||
required TResult Function(String? message) unauthorized,
|
||||
required TResult Function(String? message) forbidden,
|
||||
required TResult Function(String? message) notFound,
|
||||
required TResult Function(int? statusCode, String? message) server,
|
||||
required TResult Function(String? message) database,
|
||||
required TResult Function(String? message, Map<String, String>? fieldErrors)
|
||||
validation,
|
||||
required TResult Function(String? message) parsing,
|
||||
}) {
|
||||
return parsing(message);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(String? message)? unknown,
|
||||
TResult? Function(String? message)? network,
|
||||
TResult? Function(String? message)? unauthorized,
|
||||
TResult? Function(String? message)? forbidden,
|
||||
TResult? Function(String? message)? notFound,
|
||||
TResult? Function(int? statusCode, String? message)? server,
|
||||
TResult? Function(String? message)? database,
|
||||
TResult? Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult? Function(String? message)? parsing,
|
||||
}) {
|
||||
return parsing?.call(message);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(String? message)? unknown,
|
||||
TResult Function(String? message)? network,
|
||||
TResult Function(String? message)? unauthorized,
|
||||
TResult Function(String? message)? forbidden,
|
||||
TResult Function(String? message)? notFound,
|
||||
TResult Function(int? statusCode, String? message)? server,
|
||||
TResult Function(String? message)? database,
|
||||
TResult Function(String? message, Map<String, String>? fieldErrors)?
|
||||
validation,
|
||||
TResult Function(String? message)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (parsing != null) {
|
||||
return parsing(message);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>({
|
||||
required TResult Function(UnknownError value) unknown,
|
||||
required TResult Function(NetworkError value) network,
|
||||
required TResult Function(UnauthorizedError value) unauthorized,
|
||||
required TResult Function(ForbiddenError value) forbidden,
|
||||
required TResult Function(NotFoundError value) notFound,
|
||||
required TResult Function(ServerError value) server,
|
||||
required TResult Function(DatabaseError value) database,
|
||||
required TResult Function(ValidationError value) validation,
|
||||
required TResult Function(ParsingError value) parsing,
|
||||
}) {
|
||||
return parsing(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>({
|
||||
TResult? Function(UnknownError value)? unknown,
|
||||
TResult? Function(NetworkError value)? network,
|
||||
TResult? Function(UnauthorizedError value)? unauthorized,
|
||||
TResult? Function(ForbiddenError value)? forbidden,
|
||||
TResult? Function(NotFoundError value)? notFound,
|
||||
TResult? Function(ServerError value)? server,
|
||||
TResult? Function(DatabaseError value)? database,
|
||||
TResult? Function(ValidationError value)? validation,
|
||||
TResult? Function(ParsingError value)? parsing,
|
||||
}) {
|
||||
return parsing?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>({
|
||||
TResult Function(UnknownError value)? unknown,
|
||||
TResult Function(NetworkError value)? network,
|
||||
TResult Function(UnauthorizedError value)? unauthorized,
|
||||
TResult Function(ForbiddenError value)? forbidden,
|
||||
TResult Function(NotFoundError value)? notFound,
|
||||
TResult Function(ServerError value)? server,
|
||||
TResult Function(DatabaseError value)? database,
|
||||
TResult Function(ValidationError value)? validation,
|
||||
TResult Function(ParsingError value)? parsing,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (parsing != null) {
|
||||
return parsing(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ParsingError implements AppError {
|
||||
const factory ParsingError({final String? message}) = _$ParsingErrorImpl;
|
||||
|
||||
@override
|
||||
String? get message;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$ParsingErrorImplCopyWith<_$ParsingErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,23 @@ class Result<T> {
|
||||
return onFailure(error!);
|
||||
}
|
||||
|
||||
R fold<R>(
|
||||
R Function(AppError error) onFailure,
|
||||
R Function(T data) onSuccess,
|
||||
) {
|
||||
if (isSuccess) {
|
||||
return onSuccess(data as T);
|
||||
}
|
||||
return onFailure(error!);
|
||||
}
|
||||
|
||||
Result<R> map<R>(R Function(T data) transform) {
|
||||
if (isSuccess) {
|
||||
return Result.success(transform(data as T));
|
||||
}
|
||||
return Result.failure(error!);
|
||||
}
|
||||
|
||||
T getOrThrow() {
|
||||
if (isFailure) {
|
||||
throw error!;
|
||||
|
||||
Reference in New Issue
Block a user