move auth feature from container to profile

This commit is contained in:
Fabian Freund
2026-02-12 10:25:44 +01:00
parent 9f7637dd06
commit 45f54ef092
28 changed files with 903 additions and 455 deletions
+23 -4
View File
@@ -9,6 +9,8 @@ part of 'profile.dart';
abstract class _$ProfileCWProxy {
Profile name(String name);
Profile authSettings(AuthSettings? authSettings);
/// Creates a new instance with the provided field values.
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `Profile(...).copyWith.fieldName(value)`.
///
@@ -16,7 +18,7 @@ abstract class _$ProfileCWProxy {
/// ```dart
/// Profile(...).copyWith(id: 12, name: "My name")
/// ```
Profile call({String name});
Profile call({String name, AuthSettings? authSettings});
}
/// Callable proxy for `copyWith` functionality.
@@ -29,6 +31,10 @@ class _$ProfileCWProxyImpl implements _$ProfileCWProxy {
@override
Profile name(String name) => call(name: name);
@override
Profile authSettings(AuthSettings? authSettings) =>
call(authSettings: authSettings);
@override
/// Creates a new instance with the provided field values.
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `Profile(...).copyWith.fieldName(value)`.
@@ -37,13 +43,20 @@ class _$ProfileCWProxyImpl implements _$ProfileCWProxy {
/// ```dart
/// Profile(...).copyWith(id: 12, name: "My name")
/// ```
Profile call({Object? name = const $CopyWithPlaceholder()}) {
Profile call({
Object? name = const $CopyWithPlaceholder(),
Object? authSettings = const $CopyWithPlaceholder(),
}) {
return Profile(
id: _value.id,
name: name == const $CopyWithPlaceholder() || name == null
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
authSettings: authSettings == const $CopyWithPlaceholder()
? _value.authSettings
// ignore: cast_nullable_to_non_nullable
: authSettings as AuthSettings?,
);
}
}
@@ -59,10 +72,16 @@ extension $ProfileCopyWith on Profile {
// JsonSerializableGenerator
// **************************************************************************
Profile _$ProfileFromJson(Map<String, dynamic> json) =>
Profile(id: json['id'] as String, name: json['name'] as String);
Profile _$ProfileFromJson(Map<String, dynamic> json) => Profile(
id: json['id'] as String,
name: json['name'] as String,
authSettings: json['authSettings'] == null
? null
: AuthSettings.fromJson(json['authSettings'] as Map<String, dynamic>),
);
Map<String, dynamic> _$ProfileToJson(Profile instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
'authSettings': instance.authSettings.toJson(),
};