69 lines
2.4 KiB
Dart
69 lines
2.4 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'profile.dart';
|
|
|
|
// **************************************************************************
|
|
// CopyWithGenerator
|
|
// **************************************************************************
|
|
|
|
abstract class _$ProfileCWProxy {
|
|
Profile name(String name);
|
|
|
|
/// 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)`.
|
|
///
|
|
/// Example:
|
|
/// ```dart
|
|
/// Profile(...).copyWith(id: 12, name: "My name")
|
|
/// ```
|
|
Profile call({String name});
|
|
}
|
|
|
|
/// Callable proxy for `copyWith` functionality.
|
|
/// Use as `instanceOfProfile.copyWith(...)` or call `instanceOfProfile.copyWith.fieldName(value)` for a single field.
|
|
class _$ProfileCWProxyImpl implements _$ProfileCWProxy {
|
|
const _$ProfileCWProxyImpl(this._value);
|
|
|
|
final Profile _value;
|
|
|
|
@override
|
|
Profile name(String name) => call(name: name);
|
|
|
|
@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)`.
|
|
///
|
|
/// Example:
|
|
/// ```dart
|
|
/// Profile(...).copyWith(id: 12, name: "My name")
|
|
/// ```
|
|
Profile call({Object? name = const $CopyWithPlaceholder()}) {
|
|
return Profile(
|
|
id: _value.id,
|
|
name: name == const $CopyWithPlaceholder() || name == null
|
|
? _value.name
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: name as String,
|
|
);
|
|
}
|
|
}
|
|
|
|
extension $ProfileCopyWith on Profile {
|
|
/// Returns a callable class used to build a new instance with modified fields.
|
|
/// Example: `instanceOfProfile.copyWith(...)` or `instanceOfProfile.copyWith.fieldName(...)`.
|
|
// ignore: library_private_types_in_public_api
|
|
_$ProfileCWProxy get copyWith => _$ProfileCWProxyImpl(this);
|
|
}
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
Profile _$ProfileFromJson(Map<String, dynamic> json) =>
|
|
Profile(id: json['id'] as String, name: json['name'] as String);
|
|
|
|
Map<String, dynamic> _$ProfileToJson(Profile instance) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'name': instance.name,
|
|
};
|