forked from eatvio/eatvio_app
refactor(diary): API methods all refactored and new nutrition charty finished
This commit is contained in:
@@ -7,9 +7,8 @@ part 'photo.g.dart';
|
||||
class Photo with _$Photo {
|
||||
const factory Photo({
|
||||
required int id,
|
||||
required String originalName,
|
||||
required String original_name,
|
||||
required String path,
|
||||
required int size,
|
||||
}) = _Photo;
|
||||
|
||||
factory Photo.fromJson(Map<String, Object?> json) => _$PhotoFromJson(json);
|
||||
|
||||
@@ -21,9 +21,8 @@ Photo _$PhotoFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$Photo {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get originalName => throw _privateConstructorUsedError;
|
||||
String get original_name => throw _privateConstructorUsedError;
|
||||
String get path => throw _privateConstructorUsedError;
|
||||
int get size => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@JsonKey(ignore: true)
|
||||
@@ -35,7 +34,7 @@ abstract class $PhotoCopyWith<$Res> {
|
||||
factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) =
|
||||
_$PhotoCopyWithImpl<$Res, Photo>;
|
||||
@useResult
|
||||
$Res call({int id, String originalName, String path, int size});
|
||||
$Res call({int id, String original_name, String path});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -52,27 +51,22 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo>
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? originalName = null,
|
||||
Object? original_name = null,
|
||||
Object? path = null,
|
||||
Object? size = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
originalName: null == originalName
|
||||
? _value.originalName
|
||||
: originalName // ignore: cast_nullable_to_non_nullable
|
||||
original_name: null == original_name
|
||||
? _value.original_name
|
||||
: original_name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
path: null == path
|
||||
? _value.path
|
||||
: path // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
size: null == size
|
||||
? _value.size
|
||||
: size // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -84,7 +78,7 @@ abstract class _$$PhotoImplCopyWith<$Res> implements $PhotoCopyWith<$Res> {
|
||||
__$$PhotoImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int id, String originalName, String path, int size});
|
||||
$Res call({int id, String original_name, String path});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -99,27 +93,22 @@ class __$$PhotoImplCopyWithImpl<$Res>
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? originalName = null,
|
||||
Object? original_name = null,
|
||||
Object? path = null,
|
||||
Object? size = null,
|
||||
}) {
|
||||
return _then(_$PhotoImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
originalName: null == originalName
|
||||
? _value.originalName
|
||||
: originalName // ignore: cast_nullable_to_non_nullable
|
||||
original_name: null == original_name
|
||||
? _value.original_name
|
||||
: original_name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
path: null == path
|
||||
? _value.path
|
||||
: path // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
size: null == size
|
||||
? _value.size
|
||||
: size // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -128,10 +117,7 @@ class __$$PhotoImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$PhotoImpl implements _Photo {
|
||||
const _$PhotoImpl(
|
||||
{required this.id,
|
||||
required this.originalName,
|
||||
required this.path,
|
||||
required this.size});
|
||||
{required this.id, required this.original_name, required this.path});
|
||||
|
||||
factory _$PhotoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$PhotoImplFromJson(json);
|
||||
@@ -139,15 +125,13 @@ class _$PhotoImpl implements _Photo {
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final String originalName;
|
||||
final String original_name;
|
||||
@override
|
||||
final String path;
|
||||
@override
|
||||
final int size;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Photo(id: $id, originalName: $originalName, path: $path, size: $size)';
|
||||
return 'Photo(id: $id, original_name: $original_name, path: $path)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -156,15 +140,14 @@ class _$PhotoImpl implements _Photo {
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$PhotoImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.originalName, originalName) ||
|
||||
other.originalName == originalName) &&
|
||||
(identical(other.path, path) || other.path == path) &&
|
||||
(identical(other.size, size) || other.size == size));
|
||||
(identical(other.original_name, original_name) ||
|
||||
other.original_name == original_name) &&
|
||||
(identical(other.path, path) || other.path == path));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, originalName, path, size);
|
||||
int get hashCode => Object.hash(runtimeType, id, original_name, path);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@@ -183,21 +166,18 @@ class _$PhotoImpl implements _Photo {
|
||||
abstract class _Photo implements Photo {
|
||||
const factory _Photo(
|
||||
{required final int id,
|
||||
required final String originalName,
|
||||
required final String path,
|
||||
required final int size}) = _$PhotoImpl;
|
||||
required final String original_name,
|
||||
required final String path}) = _$PhotoImpl;
|
||||
|
||||
factory _Photo.fromJson(Map<String, dynamic> json) = _$PhotoImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
String get originalName;
|
||||
String get original_name;
|
||||
@override
|
||||
String get path;
|
||||
@override
|
||||
int get size;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$PhotoImplCopyWith<_$PhotoImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
@@ -8,15 +8,13 @@ part of 'photo.dart';
|
||||
|
||||
_$PhotoImpl _$$PhotoImplFromJson(Map<String, dynamic> json) => _$PhotoImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
originalName: json['originalName'] as String,
|
||||
original_name: json['original_name'] as String,
|
||||
path: json['path'] as String,
|
||||
size: (json['size'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$PhotoImplToJson(_$PhotoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'originalName': instance.originalName,
|
||||
'original_name': instance.original_name,
|
||||
'path': instance.path,
|
||||
'size': instance.size,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user