
Adds an `image` field to the user data structure to support profile pictures. Introduces a new profile page and sets up navigation from the home screen. Changes the product list page provider to auto dispose for improved resource management.
164 lines
6.5 KiB
Dart
164 lines
6.5 KiB
Dart
// dart format width=80
|
|
// 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 'user_struct.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// dart format off
|
|
T _$identity<T>(T value) => value;
|
|
|
|
/// @nodoc
|
|
mixin _$UserStruct {
|
|
|
|
String? get id; String? get image; String? get firstName; String? get lastName; String? get email; String? get phone;
|
|
/// Create a copy of UserStruct
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$UserStructCopyWith<UserStruct> get copyWith => _$UserStructCopyWithImpl<UserStruct>(this as UserStruct, _$identity);
|
|
|
|
/// Serializes this UserStruct to a JSON map.
|
|
Map<String, dynamic> toJson();
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserStruct&&(identical(other.id, id) || other.id == id)&&(identical(other.image, image) || other.image == image)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,id,image,firstName,lastName,email,phone);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'UserStruct(id: $id, image: $image, firstName: $firstName, lastName: $lastName, email: $email, phone: $phone)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $UserStructCopyWith<$Res> {
|
|
factory $UserStructCopyWith(UserStruct value, $Res Function(UserStruct) _then) = _$UserStructCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
String? id, String? image, String? firstName, String? lastName, String? email, String? phone
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
/// @nodoc
|
|
class _$UserStructCopyWithImpl<$Res>
|
|
implements $UserStructCopyWith<$Res> {
|
|
_$UserStructCopyWithImpl(this._self, this._then);
|
|
|
|
final UserStruct _self;
|
|
final $Res Function(UserStruct) _then;
|
|
|
|
/// Create a copy of UserStruct
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? image = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? email = freezed,Object? phone = freezed,}) {
|
|
return _then(_self.copyWith(
|
|
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
|
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
|
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
|
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
|
as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable
|
|
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
));
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
|
|
class _UserStruct implements UserStruct {
|
|
_UserStruct({this.id, this.image, this.firstName, this.lastName, this.email, this.phone});
|
|
factory _UserStruct.fromJson(Map<String, dynamic> json) => _$UserStructFromJson(json);
|
|
|
|
@override final String? id;
|
|
@override final String? image;
|
|
@override final String? firstName;
|
|
@override final String? lastName;
|
|
@override final String? email;
|
|
@override final String? phone;
|
|
|
|
/// Create a copy of UserStruct
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$UserStructCopyWith<_UserStruct> get copyWith => __$UserStructCopyWithImpl<_UserStruct>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$UserStructToJson(this, );
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserStruct&&(identical(other.id, id) || other.id == id)&&(identical(other.image, image) || other.image == image)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,id,image,firstName,lastName,email,phone);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'UserStruct(id: $id, image: $image, firstName: $firstName, lastName: $lastName, email: $email, phone: $phone)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$UserStructCopyWith<$Res> implements $UserStructCopyWith<$Res> {
|
|
factory _$UserStructCopyWith(_UserStruct value, $Res Function(_UserStruct) _then) = __$UserStructCopyWithImpl;
|
|
@override @useResult
|
|
$Res call({
|
|
String? id, String? image, String? firstName, String? lastName, String? email, String? phone
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
/// @nodoc
|
|
class __$UserStructCopyWithImpl<$Res>
|
|
implements _$UserStructCopyWith<$Res> {
|
|
__$UserStructCopyWithImpl(this._self, this._then);
|
|
|
|
final _UserStruct _self;
|
|
final $Res Function(_UserStruct) _then;
|
|
|
|
/// Create a copy of UserStruct
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? image = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? email = freezed,Object? phone = freezed,}) {
|
|
return _then(_UserStruct(
|
|
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
|
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
|
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
|
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
|
as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable
|
|
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
));
|
|
}
|
|
|
|
|
|
}
|
|
|
|
// dart format on
|