Skip to content

Commit

Permalink
updated phone model
Browse files Browse the repository at this point in the history
  • Loading branch information
mikezamayias committed Jan 23, 2022
1 parent 2088396 commit 21955f7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/models/phone/phone_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ abstract class PhoneModel implements _$PhoneModel {
const PhoneModel._();

const factory PhoneModel({
required String uid,
required String model,
required String imageUrl,
required String soc,
Expand Down
35 changes: 29 additions & 6 deletions lib/models/phone/phone_model.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class _$PhoneModelTearOff {
const _$PhoneModelTearOff();

_PhoneModel call(
{required String model,
{required String uid,
required String model,
required String imageUrl,
required String soc,
required int ram,
Expand All @@ -35,6 +36,7 @@ class _$PhoneModelTearOff {
required int stock,
required double sar}) {
return _PhoneModel(
uid: uid,
model: model,
imageUrl: imageUrl,
soc: soc,
Expand All @@ -59,6 +61,7 @@ const $PhoneModel = _$PhoneModelTearOff();

/// @nodoc
mixin _$PhoneModel {
String get uid => throw _privateConstructorUsedError;
String get model => throw _privateConstructorUsedError;
String get imageUrl => throw _privateConstructorUsedError;
String get soc => throw _privateConstructorUsedError;
Expand All @@ -83,7 +86,8 @@ abstract class $PhoneModelCopyWith<$Res> {
PhoneModel value, $Res Function(PhoneModel) then) =
_$PhoneModelCopyWithImpl<$Res>;
$Res call(
{String model,
{String uid,
String model,
String imageUrl,
String soc,
int ram,
Expand All @@ -106,6 +110,7 @@ class _$PhoneModelCopyWithImpl<$Res> implements $PhoneModelCopyWith<$Res> {

@override
$Res call({
Object? uid = freezed,
Object? model = freezed,
Object? imageUrl = freezed,
Object? soc = freezed,
Expand All @@ -119,6 +124,10 @@ class _$PhoneModelCopyWithImpl<$Res> implements $PhoneModelCopyWith<$Res> {
Object? sar = freezed,
}) {
return _then(_value.copyWith(
uid: uid == freezed
? _value.uid
: uid // ignore: cast_nullable_to_non_nullable
as String,
model: model == freezed
? _value.model
: model // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -174,7 +183,8 @@ abstract class _$PhoneModelCopyWith<$Res> implements $PhoneModelCopyWith<$Res> {
__$PhoneModelCopyWithImpl<$Res>;
@override
$Res call(
{String model,
{String uid,
String model,
String imageUrl,
String soc,
int ram,
Expand All @@ -199,6 +209,7 @@ class __$PhoneModelCopyWithImpl<$Res> extends _$PhoneModelCopyWithImpl<$Res>

@override
$Res call({
Object? uid = freezed,
Object? model = freezed,
Object? imageUrl = freezed,
Object? soc = freezed,
Expand All @@ -212,6 +223,10 @@ class __$PhoneModelCopyWithImpl<$Res> extends _$PhoneModelCopyWithImpl<$Res>
Object? sar = freezed,
}) {
return _then(_PhoneModel(
uid: uid == freezed
? _value.uid
: uid // ignore: cast_nullable_to_non_nullable
as String,
model: model == freezed
? _value.model
: model // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -264,7 +279,8 @@ class __$PhoneModelCopyWithImpl<$Res> extends _$PhoneModelCopyWithImpl<$Res>
@JsonSerializable()
class _$_PhoneModel extends _PhoneModel {
const _$_PhoneModel(
{required this.model,
{required this.uid,
required this.model,
required this.imageUrl,
required this.soc,
required this.ram,
Expand All @@ -280,6 +296,8 @@ class _$_PhoneModel extends _PhoneModel {
factory _$_PhoneModel.fromJson(Map<String, dynamic> json) =>
_$$_PhoneModelFromJson(json);

@override
final String uid;
@override
final String model;
@override
Expand All @@ -305,14 +323,15 @@ class _$_PhoneModel extends _PhoneModel {

@override
String toString() {
return 'PhoneModel(model: $model, imageUrl: $imageUrl, soc: $soc, ram: $ram, storage: $storage, screenSize: $screenSize, battery: $battery, camera: $camera, price: $price, stock: $stock, sar: $sar)';
return 'PhoneModel(uid: $uid, model: $model, imageUrl: $imageUrl, soc: $soc, ram: $ram, storage: $storage, screenSize: $screenSize, battery: $battery, camera: $camera, price: $price, stock: $stock, sar: $sar)';
}

@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _PhoneModel &&
const DeepCollectionEquality().equals(other.uid, uid) &&
const DeepCollectionEquality().equals(other.model, model) &&
const DeepCollectionEquality().equals(other.imageUrl, imageUrl) &&
const DeepCollectionEquality().equals(other.soc, soc) &&
Expand All @@ -330,6 +349,7 @@ class _$_PhoneModel extends _PhoneModel {
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(uid),
const DeepCollectionEquality().hash(model),
const DeepCollectionEquality().hash(imageUrl),
const DeepCollectionEquality().hash(soc),
Expand All @@ -355,7 +375,8 @@ class _$_PhoneModel extends _PhoneModel {

abstract class _PhoneModel extends PhoneModel {
const factory _PhoneModel(
{required String model,
{required String uid,
required String model,
required String imageUrl,
required String soc,
required int ram,
Expand All @@ -371,6 +392,8 @@ abstract class _PhoneModel extends PhoneModel {
factory _PhoneModel.fromJson(Map<String, dynamic> json) =
_$_PhoneModel.fromJson;

@override
String get uid;
@override
String get model;
@override
Expand Down
2 changes: 2 additions & 0 deletions lib/models/phone/phone_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 21955f7

Please sign in to comment.