forked from eatvio/eatvio_app
fix: remove ignored files
This commit is contained in:
@@ -1,287 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'profile_settings_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
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 information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ProfileSettingsModel _$ProfileSettingsModelFromJson(Map<String, dynamic> json) {
|
||||
return _ProfileSettingsModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ProfileSettingsModel {
|
||||
@JsonKey(name: "new_updates_notifications")
|
||||
dynamic get newUpdatesNotifications => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "diary_reminder_notifications")
|
||||
dynamic get diaryReminderNotifications => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "is_mood_fillable")
|
||||
bool get isMoodFillable => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "is_bedtime_fillable")
|
||||
bool get isBedtimeFillable => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "is_public_profile")
|
||||
bool get isPublicProfile => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ProfileSettingsModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ProfileSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ProfileSettingsModelCopyWith<ProfileSettingsModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ProfileSettingsModelCopyWith<$Res> {
|
||||
factory $ProfileSettingsModelCopyWith(ProfileSettingsModel value,
|
||||
$Res Function(ProfileSettingsModel) then) =
|
||||
_$ProfileSettingsModelCopyWithImpl<$Res, ProfileSettingsModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "new_updates_notifications")
|
||||
dynamic newUpdatesNotifications,
|
||||
@JsonKey(name: "diary_reminder_notifications")
|
||||
dynamic diaryReminderNotifications,
|
||||
@JsonKey(name: "is_mood_fillable") bool isMoodFillable,
|
||||
@JsonKey(name: "is_bedtime_fillable") bool isBedtimeFillable,
|
||||
@JsonKey(name: "is_public_profile") bool isPublicProfile});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ProfileSettingsModelCopyWithImpl<$Res,
|
||||
$Val extends ProfileSettingsModel>
|
||||
implements $ProfileSettingsModelCopyWith<$Res> {
|
||||
_$ProfileSettingsModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ProfileSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? newUpdatesNotifications = freezed,
|
||||
Object? diaryReminderNotifications = freezed,
|
||||
Object? isMoodFillable = null,
|
||||
Object? isBedtimeFillable = null,
|
||||
Object? isPublicProfile = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
newUpdatesNotifications: freezed == newUpdatesNotifications
|
||||
? _value.newUpdatesNotifications
|
||||
: newUpdatesNotifications // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
diaryReminderNotifications: freezed == diaryReminderNotifications
|
||||
? _value.diaryReminderNotifications
|
||||
: diaryReminderNotifications // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
isMoodFillable: null == isMoodFillable
|
||||
? _value.isMoodFillable
|
||||
: isMoodFillable // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isBedtimeFillable: null == isBedtimeFillable
|
||||
? _value.isBedtimeFillable
|
||||
: isBedtimeFillable // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isPublicProfile: null == isPublicProfile
|
||||
? _value.isPublicProfile
|
||||
: isPublicProfile // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProfileSettingsModelImplCopyWith<$Res>
|
||||
implements $ProfileSettingsModelCopyWith<$Res> {
|
||||
factory _$$ProfileSettingsModelImplCopyWith(_$ProfileSettingsModelImpl value,
|
||||
$Res Function(_$ProfileSettingsModelImpl) then) =
|
||||
__$$ProfileSettingsModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "new_updates_notifications")
|
||||
dynamic newUpdatesNotifications,
|
||||
@JsonKey(name: "diary_reminder_notifications")
|
||||
dynamic diaryReminderNotifications,
|
||||
@JsonKey(name: "is_mood_fillable") bool isMoodFillable,
|
||||
@JsonKey(name: "is_bedtime_fillable") bool isBedtimeFillable,
|
||||
@JsonKey(name: "is_public_profile") bool isPublicProfile});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProfileSettingsModelImplCopyWithImpl<$Res>
|
||||
extends _$ProfileSettingsModelCopyWithImpl<$Res, _$ProfileSettingsModelImpl>
|
||||
implements _$$ProfileSettingsModelImplCopyWith<$Res> {
|
||||
__$$ProfileSettingsModelImplCopyWithImpl(_$ProfileSettingsModelImpl _value,
|
||||
$Res Function(_$ProfileSettingsModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ProfileSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? newUpdatesNotifications = freezed,
|
||||
Object? diaryReminderNotifications = freezed,
|
||||
Object? isMoodFillable = null,
|
||||
Object? isBedtimeFillable = null,
|
||||
Object? isPublicProfile = null,
|
||||
}) {
|
||||
return _then(_$ProfileSettingsModelImpl(
|
||||
newUpdatesNotifications: freezed == newUpdatesNotifications
|
||||
? _value.newUpdatesNotifications
|
||||
: newUpdatesNotifications // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
diaryReminderNotifications: freezed == diaryReminderNotifications
|
||||
? _value.diaryReminderNotifications
|
||||
: diaryReminderNotifications // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
isMoodFillable: null == isMoodFillable
|
||||
? _value.isMoodFillable
|
||||
: isMoodFillable // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isBedtimeFillable: null == isBedtimeFillable
|
||||
? _value.isBedtimeFillable
|
||||
: isBedtimeFillable // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isPublicProfile: null == isPublicProfile
|
||||
? _value.isPublicProfile
|
||||
: isPublicProfile // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ProfileSettingsModelImpl implements _ProfileSettingsModel {
|
||||
const _$ProfileSettingsModelImpl(
|
||||
{@JsonKey(name: "new_updates_notifications")
|
||||
required this.newUpdatesNotifications,
|
||||
@JsonKey(name: "diary_reminder_notifications")
|
||||
required this.diaryReminderNotifications,
|
||||
@JsonKey(name: "is_mood_fillable") required this.isMoodFillable,
|
||||
@JsonKey(name: "is_bedtime_fillable") required this.isBedtimeFillable,
|
||||
@JsonKey(name: "is_public_profile") required this.isPublicProfile});
|
||||
|
||||
factory _$ProfileSettingsModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ProfileSettingsModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "new_updates_notifications")
|
||||
final dynamic newUpdatesNotifications;
|
||||
@override
|
||||
@JsonKey(name: "diary_reminder_notifications")
|
||||
final dynamic diaryReminderNotifications;
|
||||
@override
|
||||
@JsonKey(name: "is_mood_fillable")
|
||||
final bool isMoodFillable;
|
||||
@override
|
||||
@JsonKey(name: "is_bedtime_fillable")
|
||||
final bool isBedtimeFillable;
|
||||
@override
|
||||
@JsonKey(name: "is_public_profile")
|
||||
final bool isPublicProfile;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProfileSettingsModel(newUpdatesNotifications: $newUpdatesNotifications, diaryReminderNotifications: $diaryReminderNotifications, isMoodFillable: $isMoodFillable, isBedtimeFillable: $isBedtimeFillable, isPublicProfile: $isPublicProfile)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ProfileSettingsModelImpl &&
|
||||
const DeepCollectionEquality().equals(
|
||||
other.newUpdatesNotifications, newUpdatesNotifications) &&
|
||||
const DeepCollectionEquality().equals(
|
||||
other.diaryReminderNotifications, diaryReminderNotifications) &&
|
||||
(identical(other.isMoodFillable, isMoodFillable) ||
|
||||
other.isMoodFillable == isMoodFillable) &&
|
||||
(identical(other.isBedtimeFillable, isBedtimeFillable) ||
|
||||
other.isBedtimeFillable == isBedtimeFillable) &&
|
||||
(identical(other.isPublicProfile, isPublicProfile) ||
|
||||
other.isPublicProfile == isPublicProfile));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
const DeepCollectionEquality().hash(newUpdatesNotifications),
|
||||
const DeepCollectionEquality().hash(diaryReminderNotifications),
|
||||
isMoodFillable,
|
||||
isBedtimeFillable,
|
||||
isPublicProfile);
|
||||
|
||||
/// Create a copy of ProfileSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ProfileSettingsModelImplCopyWith<_$ProfileSettingsModelImpl>
|
||||
get copyWith =>
|
||||
__$$ProfileSettingsModelImplCopyWithImpl<_$ProfileSettingsModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ProfileSettingsModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ProfileSettingsModel implements ProfileSettingsModel {
|
||||
const factory _ProfileSettingsModel(
|
||||
{@JsonKey(name: "new_updates_notifications")
|
||||
required final dynamic newUpdatesNotifications,
|
||||
@JsonKey(name: "diary_reminder_notifications")
|
||||
required final dynamic diaryReminderNotifications,
|
||||
@JsonKey(name: "is_mood_fillable") required final bool isMoodFillable,
|
||||
@JsonKey(name: "is_bedtime_fillable")
|
||||
required final bool isBedtimeFillable,
|
||||
@JsonKey(name: "is_public_profile")
|
||||
required final bool isPublicProfile}) = _$ProfileSettingsModelImpl;
|
||||
|
||||
factory _ProfileSettingsModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ProfileSettingsModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "new_updates_notifications")
|
||||
dynamic get newUpdatesNotifications;
|
||||
@override
|
||||
@JsonKey(name: "diary_reminder_notifications")
|
||||
dynamic get diaryReminderNotifications;
|
||||
@override
|
||||
@JsonKey(name: "is_mood_fillable")
|
||||
bool get isMoodFillable;
|
||||
@override
|
||||
@JsonKey(name: "is_bedtime_fillable")
|
||||
bool get isBedtimeFillable;
|
||||
@override
|
||||
@JsonKey(name: "is_public_profile")
|
||||
bool get isPublicProfile;
|
||||
|
||||
/// Create a copy of ProfileSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ProfileSettingsModelImplCopyWith<_$ProfileSettingsModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'profile_settings_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ProfileSettingsModelImpl _$$ProfileSettingsModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ProfileSettingsModelImpl(
|
||||
newUpdatesNotifications: json['new_updates_notifications'],
|
||||
diaryReminderNotifications: json['diary_reminder_notifications'],
|
||||
isMoodFillable: json['is_mood_fillable'] as bool,
|
||||
isBedtimeFillable: json['is_bedtime_fillable'] as bool,
|
||||
isPublicProfile: json['is_public_profile'] as bool,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ProfileSettingsModelImplToJson(
|
||||
_$ProfileSettingsModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'new_updates_notifications': instance.newUpdatesNotifications,
|
||||
'diary_reminder_notifications': instance.diaryReminderNotifications,
|
||||
'is_mood_fillable': instance.isMoodFillable,
|
||||
'is_bedtime_fillable': instance.isBedtimeFillable,
|
||||
'is_public_profile': instance.isPublicProfile,
|
||||
};
|
||||
@@ -1,727 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'settings_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
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 information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SettingsState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value) $default, {
|
||||
required TResult Function(SettingsStateLoading value) loading,
|
||||
required TResult Function(SettingsStateLoaded value) loaded,
|
||||
required TResult Function(SettingsStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SettingsState value)? $default, {
|
||||
TResult? Function(SettingsStateLoading value)? loading,
|
||||
TResult? Function(SettingsStateLoaded value)? loaded,
|
||||
TResult? Function(SettingsStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value)? $default, {
|
||||
TResult Function(SettingsStateLoading value)? loading,
|
||||
TResult Function(SettingsStateLoaded value)? loaded,
|
||||
TResult Function(SettingsStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $SettingsStateCopyWith<$Res> {
|
||||
factory $SettingsStateCopyWith(
|
||||
SettingsState value, $Res Function(SettingsState) then) =
|
||||
_$SettingsStateCopyWithImpl<$Res, SettingsState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$SettingsStateCopyWithImpl<$Res, $Val extends SettingsState>
|
||||
implements $SettingsStateCopyWith<$Res> {
|
||||
_$SettingsStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SettingsStateImplCopyWith<$Res> {
|
||||
factory _$$SettingsStateImplCopyWith(
|
||||
_$SettingsStateImpl value, $Res Function(_$SettingsStateImpl) then) =
|
||||
__$$SettingsStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SettingsStateImplCopyWithImpl<$Res>
|
||||
extends _$SettingsStateCopyWithImpl<$Res, _$SettingsStateImpl>
|
||||
implements _$$SettingsStateImplCopyWith<$Res> {
|
||||
__$$SettingsStateImplCopyWithImpl(
|
||||
_$SettingsStateImpl _value, $Res Function(_$SettingsStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SettingsStateImpl implements _SettingsState {
|
||||
const _$SettingsStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SettingsState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$SettingsStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value) $default, {
|
||||
required TResult Function(SettingsStateLoading value) loading,
|
||||
required TResult Function(SettingsStateLoaded value) loaded,
|
||||
required TResult Function(SettingsStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SettingsState value)? $default, {
|
||||
TResult? Function(SettingsStateLoading value)? loading,
|
||||
TResult? Function(SettingsStateLoaded value)? loaded,
|
||||
TResult? Function(SettingsStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value)? $default, {
|
||||
TResult Function(SettingsStateLoading value)? loading,
|
||||
TResult Function(SettingsStateLoaded value)? loaded,
|
||||
TResult Function(SettingsStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _SettingsState implements SettingsState {
|
||||
const factory _SettingsState() = _$SettingsStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SettingsStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$SettingsStateLoadingImplCopyWith(_$SettingsStateLoadingImpl value,
|
||||
$Res Function(_$SettingsStateLoadingImpl) then) =
|
||||
__$$SettingsStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SettingsStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$SettingsStateCopyWithImpl<$Res, _$SettingsStateLoadingImpl>
|
||||
implements _$$SettingsStateLoadingImplCopyWith<$Res> {
|
||||
__$$SettingsStateLoadingImplCopyWithImpl(_$SettingsStateLoadingImpl _value,
|
||||
$Res Function(_$SettingsStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SettingsStateLoadingImpl implements SettingsStateLoading {
|
||||
const _$SettingsStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SettingsState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$SettingsStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value) $default, {
|
||||
required TResult Function(SettingsStateLoading value) loading,
|
||||
required TResult Function(SettingsStateLoaded value) loaded,
|
||||
required TResult Function(SettingsStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SettingsState value)? $default, {
|
||||
TResult? Function(SettingsStateLoading value)? loading,
|
||||
TResult? Function(SettingsStateLoaded value)? loaded,
|
||||
TResult? Function(SettingsStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value)? $default, {
|
||||
TResult Function(SettingsStateLoading value)? loading,
|
||||
TResult Function(SettingsStateLoaded value)? loaded,
|
||||
TResult Function(SettingsStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class SettingsStateLoading implements SettingsState {
|
||||
const factory SettingsStateLoading() = _$SettingsStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SettingsStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$SettingsStateLoadedImplCopyWith(_$SettingsStateLoadedImpl value,
|
||||
$Res Function(_$SettingsStateLoadedImpl) then) =
|
||||
__$$SettingsStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails,
|
||||
ProfileModel profile});
|
||||
|
||||
$ProfileSettingsModelCopyWith<$Res> get profileSettings;
|
||||
$ProfileDetailsModelCopyWith<$Res> get profileDetails;
|
||||
$ProfileModelCopyWith<$Res> get profile;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SettingsStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$SettingsStateCopyWithImpl<$Res, _$SettingsStateLoadedImpl>
|
||||
implements _$$SettingsStateLoadedImplCopyWith<$Res> {
|
||||
__$$SettingsStateLoadedImplCopyWithImpl(_$SettingsStateLoadedImpl _value,
|
||||
$Res Function(_$SettingsStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? profileSettings = null,
|
||||
Object? profileDetails = null,
|
||||
Object? profile = null,
|
||||
}) {
|
||||
return _then(_$SettingsStateLoadedImpl(
|
||||
profileSettings: null == profileSettings
|
||||
? _value.profileSettings
|
||||
: profileSettings // ignore: cast_nullable_to_non_nullable
|
||||
as ProfileSettingsModel,
|
||||
profileDetails: null == profileDetails
|
||||
? _value.profileDetails
|
||||
: profileDetails // ignore: cast_nullable_to_non_nullable
|
||||
as ProfileDetailsModel,
|
||||
profile: null == profile
|
||||
? _value.profile
|
||||
: profile // ignore: cast_nullable_to_non_nullable
|
||||
as ProfileModel,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ProfileSettingsModelCopyWith<$Res> get profileSettings {
|
||||
return $ProfileSettingsModelCopyWith<$Res>(_value.profileSettings, (value) {
|
||||
return _then(_value.copyWith(profileSettings: value));
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ProfileDetailsModelCopyWith<$Res> get profileDetails {
|
||||
return $ProfileDetailsModelCopyWith<$Res>(_value.profileDetails, (value) {
|
||||
return _then(_value.copyWith(profileDetails: value));
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ProfileModelCopyWith<$Res> get profile {
|
||||
return $ProfileModelCopyWith<$Res>(_value.profile, (value) {
|
||||
return _then(_value.copyWith(profile: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SettingsStateLoadedImpl implements SettingsStateLoaded {
|
||||
const _$SettingsStateLoadedImpl(
|
||||
{required this.profileSettings,
|
||||
required this.profileDetails,
|
||||
required this.profile});
|
||||
|
||||
@override
|
||||
final ProfileSettingsModel profileSettings;
|
||||
@override
|
||||
final ProfileDetailsModel profileDetails;
|
||||
@override
|
||||
final ProfileModel profile;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SettingsState.loaded(profileSettings: $profileSettings, profileDetails: $profileDetails, profile: $profile)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$SettingsStateLoadedImpl &&
|
||||
(identical(other.profileSettings, profileSettings) ||
|
||||
other.profileSettings == profileSettings) &&
|
||||
(identical(other.profileDetails, profileDetails) ||
|
||||
other.profileDetails == profileDetails) &&
|
||||
(identical(other.profile, profile) || other.profile == profile));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, profileSettings, profileDetails, profile);
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$SettingsStateLoadedImplCopyWith<_$SettingsStateLoadedImpl> get copyWith =>
|
||||
__$$SettingsStateLoadedImplCopyWithImpl<_$SettingsStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded(profileSettings, profileDetails, profile);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call(profileSettings, profileDetails, profile);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(profileSettings, profileDetails, profile);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value) $default, {
|
||||
required TResult Function(SettingsStateLoading value) loading,
|
||||
required TResult Function(SettingsStateLoaded value) loaded,
|
||||
required TResult Function(SettingsStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SettingsState value)? $default, {
|
||||
TResult? Function(SettingsStateLoading value)? loading,
|
||||
TResult? Function(SettingsStateLoaded value)? loaded,
|
||||
TResult? Function(SettingsStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value)? $default, {
|
||||
TResult Function(SettingsStateLoading value)? loading,
|
||||
TResult Function(SettingsStateLoaded value)? loaded,
|
||||
TResult Function(SettingsStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class SettingsStateLoaded implements SettingsState {
|
||||
const factory SettingsStateLoaded(
|
||||
{required final ProfileSettingsModel profileSettings,
|
||||
required final ProfileDetailsModel profileDetails,
|
||||
required final ProfileModel profile}) = _$SettingsStateLoadedImpl;
|
||||
|
||||
ProfileSettingsModel get profileSettings;
|
||||
ProfileDetailsModel get profileDetails;
|
||||
ProfileModel get profile;
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$SettingsStateLoadedImplCopyWith<_$SettingsStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SettingsStateErrorImplCopyWith<$Res> {
|
||||
factory _$$SettingsStateErrorImplCopyWith(_$SettingsStateErrorImpl value,
|
||||
$Res Function(_$SettingsStateErrorImpl) then) =
|
||||
__$$SettingsStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SettingsStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$SettingsStateCopyWithImpl<$Res, _$SettingsStateErrorImpl>
|
||||
implements _$$SettingsStateErrorImplCopyWith<$Res> {
|
||||
__$$SettingsStateErrorImplCopyWithImpl(_$SettingsStateErrorImpl _value,
|
||||
$Res Function(_$SettingsStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$SettingsStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SettingsStateErrorImpl implements SettingsStateError {
|
||||
const _$SettingsStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SettingsState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$SettingsStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$SettingsStateErrorImplCopyWith<_$SettingsStateErrorImpl> get copyWith =>
|
||||
__$$SettingsStateErrorImplCopyWithImpl<_$SettingsStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(ProfileSettingsModel profileSettings,
|
||||
ProfileDetailsModel profileDetails, ProfileModel profile)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value) $default, {
|
||||
required TResult Function(SettingsStateLoading value) loading,
|
||||
required TResult Function(SettingsStateLoaded value) loaded,
|
||||
required TResult Function(SettingsStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_SettingsState value)? $default, {
|
||||
TResult? Function(SettingsStateLoading value)? loading,
|
||||
TResult? Function(SettingsStateLoaded value)? loaded,
|
||||
TResult? Function(SettingsStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SettingsState value)? $default, {
|
||||
TResult Function(SettingsStateLoading value)? loading,
|
||||
TResult Function(SettingsStateLoaded value)? loaded,
|
||||
TResult Function(SettingsStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class SettingsStateError implements SettingsState {
|
||||
const factory SettingsStateError({required final String errorMessage}) =
|
||||
_$SettingsStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of SettingsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$SettingsStateErrorImplCopyWith<_$SettingsStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'settings_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _SettingsService implements SettingsService {
|
||||
_SettingsService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<ProfileSettingsModel> getProfileSettings() async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<ProfileSettingsModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/settings',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ProfileSettingsModel _value;
|
||||
try {
|
||||
_value = ProfileSettingsModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ProfileSettingsModel> updateProfileSettings({
|
||||
required Map<String, dynamic> data,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(data);
|
||||
final _options = _setStreamType<ProfileSettingsModel>(
|
||||
Options(method: 'PUT', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/settings/update',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ProfileSettingsModel _value;
|
||||
try {
|
||||
_value = ProfileSettingsModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ProfileDetailsModel> updateProfileDetails({
|
||||
required Map<String, dynamic> data,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(data);
|
||||
final _options = _setStreamType<ProfileDetailsModel>(
|
||||
Options(method: 'PUT', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/update',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ProfileDetailsModel _value;
|
||||
try {
|
||||
_value = ProfileDetailsModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user