feat(feed): add diets api and create blog post screen, fix status bar

This commit is contained in:
mso7nueh
2024-08-08 10:39:53 +03:00
parent 21e03d956c
commit f4c6aebdff
67 changed files with 4253 additions and 1617 deletions

View File

@@ -21,21 +21,14 @@ Meal _$MealFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$Meal {
int get id => throw _privateConstructorUsedError;
String get time => throw _privateConstructorUsedError;
int get type => throw _privateConstructorUsedError;
int get satiety => throw _privateConstructorUsedError;
int get mood => throw _privateConstructorUsedError;
List<Portion> get portions => throw _privateConstructorUsedError;
List<Photo> get photos => throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$MealCopyWith<Meal> get copyWith => throw _privateConstructorUsedError;
}
@@ -43,16 +36,16 @@ mixin _$Meal {
/// @nodoc
abstract class $MealCopyWith<$Res> {
factory $MealCopyWith(Meal value, $Res Function(Meal) then) =
_$MealCopyWithImpl<$Res, Meal>;
_$MealCopyWithImpl<$Res, Meal>;
@useResult
$Res call({int id,
String time,
int type,
int satiety,
int mood,
List<Portion> portions,
List<Photo> photos});
$Res call(
{int id,
String time,
int type,
int satiety,
int mood,
List<Portion> portions,
List<Photo> photos});
}
/// @nodoc
@@ -62,7 +55,6 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal>
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@@ -81,53 +73,55 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal>
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
as int,
time: null == time
? _value.time
: time // ignore: cast_nullable_to_non_nullable
as String,
as String,
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as int,
as int,
satiety: null == satiety
? _value.satiety
: satiety // ignore: cast_nullable_to_non_nullable
as int,
as int,
mood: null == mood
? _value.mood
: mood // ignore: cast_nullable_to_non_nullable
as int,
as int,
portions: null == portions
? _value.portions
: portions // ignore: cast_nullable_to_non_nullable
as List<Portion>,
as List<Portion>,
photos: null == photos
? _value.photos
: photos // ignore: cast_nullable_to_non_nullable
as List<Photo>,
as List<Photo>,
) as $Val);
}
}
/// @nodoc
abstract class _$$MealImplCopyWith<$Res> implements $MealCopyWith<$Res> {
factory _$$MealImplCopyWith(_$MealImpl value, $Res Function(_$MealImpl) then) =
__$$MealImplCopyWithImpl<$Res>;
factory _$$MealImplCopyWith(
_$MealImpl value, $Res Function(_$MealImpl) then) =
__$$MealImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id,
String time,
int type,
int satiety,
int mood,
List<Portion> portions,
List<Photo> photos});
$Res call(
{int id,
String time,
int type,
int satiety,
int mood,
List<Portion> portions,
List<Photo> photos});
}
/// @nodoc
class __$$MealImplCopyWithImpl<$Res> extends _$MealCopyWithImpl<$Res, _$MealImpl>
class __$$MealImplCopyWithImpl<$Res>
extends _$MealCopyWithImpl<$Res, _$MealImpl>
implements _$$MealImplCopyWith<$Res> {
__$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then)
: super(_value, _then);
@@ -147,31 +141,31 @@ class __$$MealImplCopyWithImpl<$Res> extends _$MealCopyWithImpl<$Res, _$MealImpl
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
as int,
time: null == time
? _value.time
: time // ignore: cast_nullable_to_non_nullable
as String,
as String,
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as int,
as int,
satiety: null == satiety
? _value.satiety
: satiety // ignore: cast_nullable_to_non_nullable
as int,
as int,
mood: null == mood
? _value.mood
: mood // ignore: cast_nullable_to_non_nullable
as int,
as int,
portions: null == portions
? _value._portions
: portions // ignore: cast_nullable_to_non_nullable
as List<Portion>,
as List<Portion>,
photos: null == photos
? _value._photos
: photos // ignore: cast_nullable_to_non_nullable
as List<Photo>,
as List<Photo>,
));
}
}
@@ -179,13 +173,14 @@ class __$$MealImplCopyWithImpl<$Res> extends _$MealCopyWithImpl<$Res, _$MealImpl
/// @nodoc
@JsonSerializable()
class _$MealImpl implements _Meal {
const _$MealImpl({required this.id,
required this.time,
required this.type,
required this.satiety,
required this.mood,
required final List<Portion> portions,
required final List<Photo> photos})
const _$MealImpl(
{required this.id,
required this.time,
required this.type,
required this.satiety,
required this.mood,
required final List<Portion> portions,
required final List<Photo> photos})
: _portions = portions,
_photos = photos;
@@ -203,7 +198,6 @@ class _$MealImpl implements _Meal {
@override
final int mood;
final List<Portion> _portions;
@override
List<Portion> get portions {
if (_portions is EqualUnmodifiableListView) return _portions;
@@ -212,7 +206,6 @@ class _$MealImpl implements _Meal {
}
final List<Photo> _photos;
@override
List<Photo> get photos {
if (_photos is EqualUnmodifiableListView) return _photos;
@@ -241,16 +234,15 @@ class _$MealImpl implements _Meal {
@JsonKey(ignore: true)
@override
int get hashCode =>
Object.hash(
runtimeType,
id,
time,
type,
satiety,
mood,
const DeepCollectionEquality().hash(_portions),
const DeepCollectionEquality().hash(_photos));
int get hashCode => Object.hash(
runtimeType,
id,
time,
type,
satiety,
mood,
const DeepCollectionEquality().hash(_portions),
const DeepCollectionEquality().hash(_photos));
@JsonKey(ignore: true)
@override
@@ -267,37 +259,31 @@ class _$MealImpl implements _Meal {
}
abstract class _Meal implements Meal {
const factory _Meal({required final int id,
required final String time,
required final int type,
required final int satiety,
required final int mood,
required final List<Portion> portions,
required final List<Photo> photos}) = _$MealImpl;
const factory _Meal(
{required final int id,
required final String time,
required final int type,
required final int satiety,
required final int mood,
required final List<Portion> portions,
required final List<Photo> photos}) = _$MealImpl;
factory _Meal.fromJson(Map<String, dynamic> json) = _$MealImpl.fromJson;
@override
int get id;
@override
String get time;
@override
int get type;
@override
int get satiety;
@override
int get mood;
@override
List<Portion> get portions;
@override
List<Photo> get photos;
@override
@JsonKey(ignore: true)
_$$MealImplCopyWith<_$MealImpl> get copyWith =>

View File

@@ -6,8 +6,7 @@ part of 'meal.dart';
// JsonSerializableGenerator
// **************************************************************************
_$MealImpl _$$MealImplFromJson(Map<String, dynamic> json) =>
_$MealImpl(
_$MealImpl _$$MealImplFromJson(Map<String, dynamic> json) => _$MealImpl(
id: (json['id'] as num).toInt(),
time: json['time'] as String,
type: (json['type'] as num).toInt(),

View File

@@ -21,14 +21,11 @@ Photo _$PhotoFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$Photo {
int get id => throw _privateConstructorUsedError;
@JsonKey(name: 'original_name')
String get originalName => throw _privateConstructorUsedError;
String get path => throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$PhotoCopyWith<Photo> get copyWith => throw _privateConstructorUsedError;
}
@@ -36,12 +33,12 @@ mixin _$Photo {
/// @nodoc
abstract class $PhotoCopyWith<$Res> {
factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) =
_$PhotoCopyWithImpl<$Res, Photo>;
_$PhotoCopyWithImpl<$Res, Photo>;
@useResult
$Res call({int id,
@JsonKey(name: 'original_name') String originalName,
String path});
$Res call(
{int id,
@JsonKey(name: 'original_name') String originalName,
String path});
}
/// @nodoc
@@ -51,7 +48,6 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo>
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@@ -66,35 +62,38 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo>
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
as int,
originalName: null == originalName
? _value.originalName
: originalName // ignore: cast_nullable_to_non_nullable
as String,
as String,
path: null == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String,
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$PhotoImplCopyWith<$Res> implements $PhotoCopyWith<$Res> {
factory _$$PhotoImplCopyWith(_$PhotoImpl value, $Res Function(_$PhotoImpl) then) =
__$$PhotoImplCopyWithImpl<$Res>;
factory _$$PhotoImplCopyWith(
_$PhotoImpl value, $Res Function(_$PhotoImpl) then) =
__$$PhotoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id,
@JsonKey(name: 'original_name') String originalName,
String path});
$Res call(
{int id,
@JsonKey(name: 'original_name') String originalName,
String path});
}
/// @nodoc
class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl>
class __$$PhotoImplCopyWithImpl<$Res>
extends _$PhotoCopyWithImpl<$Res, _$PhotoImpl>
implements _$$PhotoImplCopyWith<$Res> {
__$$PhotoImplCopyWithImpl(_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then)
__$$PhotoImplCopyWithImpl(
_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then)
: super(_value, _then);
@pragma('vm:prefer-inline')
@@ -108,15 +107,15 @@ class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoI
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
as int,
originalName: null == originalName
? _value.originalName
: originalName // ignore: cast_nullable_to_non_nullable
as String,
as String,
path: null == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String,
as String,
));
}
}
@@ -124,9 +123,10 @@ class __$$PhotoImplCopyWithImpl<$Res> extends _$PhotoCopyWithImpl<$Res, _$PhotoI
/// @nodoc
@JsonSerializable()
class _$PhotoImpl implements _Photo {
const _$PhotoImpl({required this.id,
@JsonKey(name: 'original_name') required this.originalName,
required this.path});
const _$PhotoImpl(
{required this.id,
@JsonKey(name: 'original_name') required this.originalName,
required this.path});
factory _$PhotoImpl.fromJson(Map<String, dynamic> json) =>
_$$PhotoImplFromJson(json);
@@ -174,22 +174,20 @@ class _$PhotoImpl implements _Photo {
}
abstract class _Photo implements Photo {
const factory _Photo({required final int id,
@JsonKey(name: 'original_name') required final String originalName,
required final String path}) = _$PhotoImpl;
const factory _Photo(
{required final int id,
@JsonKey(name: 'original_name') required final String originalName,
required final String path}) = _$PhotoImpl;
factory _Photo.fromJson(Map<String, dynamic> json) = _$PhotoImpl.fromJson;
@override
int get id;
@override
@JsonKey(name: 'original_name')
String get originalName;
@override
String get path;
@override
@JsonKey(ignore: true)
_$$PhotoImplCopyWith<_$PhotoImpl> get copyWith =>

View File

@@ -6,8 +6,7 @@ part of 'photo.dart';
// JsonSerializableGenerator
// **************************************************************************
_$PhotoImpl _$$PhotoImplFromJson(Map<String, dynamic> json) =>
_$PhotoImpl(
_$PhotoImpl _$$PhotoImplFromJson(Map<String, dynamic> json) => _$PhotoImpl(
id: (json['id'] as num).toInt(),
originalName: json['original_name'] as String,
path: json['path'] as String,

View File

@@ -21,15 +21,11 @@ Portion _$PortionFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$Portion {
int get id => throw _privateConstructorUsedError;
String get product_name => throw _privateConstructorUsedError;
int get quantity => throw _privateConstructorUsedError;
String get portion => throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$PortionCopyWith<Portion> get copyWith => throw _privateConstructorUsedError;
}
@@ -37,8 +33,7 @@ mixin _$Portion {
/// @nodoc
abstract class $PortionCopyWith<$Res> {
factory $PortionCopyWith(Portion value, $Res Function(Portion) then) =
_$PortionCopyWithImpl<$Res, Portion>;
_$PortionCopyWithImpl<$Res, Portion>;
@useResult
$Res call({int id, String product_name, int quantity, String portion});
}
@@ -50,7 +45,6 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion>
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@@ -66,37 +60,39 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion>
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
as int,
product_name: null == product_name
? _value.product_name
: product_name // ignore: cast_nullable_to_non_nullable
as String,
as String,
quantity: null == quantity
? _value.quantity
: quantity // ignore: cast_nullable_to_non_nullable
as int,
as int,
portion: null == portion
? _value.portion
: portion // ignore: cast_nullable_to_non_nullable
as String,
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$PortionImplCopyWith<$Res> implements $PortionCopyWith<$Res> {
factory _$$PortionImplCopyWith(_$PortionImpl value, $Res Function(_$PortionImpl) then) =
__$$PortionImplCopyWithImpl<$Res>;
factory _$$PortionImplCopyWith(
_$PortionImpl value, $Res Function(_$PortionImpl) then) =
__$$PortionImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id, String product_name, int quantity, String portion});
}
/// @nodoc
class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$PortionImpl>
class __$$PortionImplCopyWithImpl<$Res>
extends _$PortionCopyWithImpl<$Res, _$PortionImpl>
implements _$$PortionImplCopyWith<$Res> {
__$$PortionImplCopyWithImpl(_$PortionImpl _value, $Res Function(_$PortionImpl) _then)
__$$PortionImplCopyWithImpl(
_$PortionImpl _value, $Res Function(_$PortionImpl) _then)
: super(_value, _then);
@pragma('vm:prefer-inline')
@@ -111,19 +107,19 @@ class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$Po
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
as int,
product_name: null == product_name
? _value.product_name
: product_name // ignore: cast_nullable_to_non_nullable
as String,
as String,
quantity: null == quantity
? _value.quantity
: quantity // ignore: cast_nullable_to_non_nullable
as int,
as int,
portion: null == portion
? _value.portion
: portion // ignore: cast_nullable_to_non_nullable
as String,
as String,
));
}
}
@@ -131,10 +127,11 @@ class __$$PortionImplCopyWithImpl<$Res> extends _$PortionCopyWithImpl<$Res, _$Po
/// @nodoc
@JsonSerializable()
class _$PortionImpl implements _Portion {
const _$PortionImpl({required this.id,
required this.product_name,
required this.quantity,
required this.portion});
const _$PortionImpl(
{required this.id,
required this.product_name,
required this.quantity,
required this.portion});
factory _$PortionImpl.fromJson(Map<String, dynamic> json) =>
_$$PortionImplFromJson(json);
@@ -186,25 +183,22 @@ class _$PortionImpl implements _Portion {
}
abstract class _Portion implements Portion {
const factory _Portion({required final int id,
required final String product_name,
required final int quantity,
required final String portion}) = _$PortionImpl;
const factory _Portion(
{required final int id,
required final String product_name,
required final int quantity,
required final String portion}) = _$PortionImpl;
factory _Portion.fromJson(Map<String, dynamic> json) = _$PortionImpl.fromJson;
@override
int get id;
@override
String get product_name;
@override
int get quantity;
@override
String get portion;
@override
@JsonKey(ignore: true)
_$$PortionImplCopyWith<_$PortionImpl> get copyWith =>

View File

@@ -21,11 +21,9 @@ Product _$ProductFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$Product {
int get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$ProductCopyWith<Product> get copyWith => throw _privateConstructorUsedError;
}
@@ -33,8 +31,7 @@ mixin _$Product {
/// @nodoc
abstract class $ProductCopyWith<$Res> {
factory $ProductCopyWith(Product value, $Res Function(Product) then) =
_$ProductCopyWithImpl<$Res, Product>;
_$ProductCopyWithImpl<$Res, Product>;
@useResult
$Res call({int id, String name});
}
@@ -46,7 +43,6 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product>
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@@ -60,29 +56,31 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product>
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
as int,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$ProductImplCopyWith<$Res> implements $ProductCopyWith<$Res> {
factory _$$ProductImplCopyWith(_$ProductImpl value, $Res Function(_$ProductImpl) then) =
__$$ProductImplCopyWithImpl<$Res>;
factory _$$ProductImplCopyWith(
_$ProductImpl value, $Res Function(_$ProductImpl) then) =
__$$ProductImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int id, String name});
}
/// @nodoc
class __$$ProductImplCopyWithImpl<$Res> extends _$ProductCopyWithImpl<$Res, _$ProductImpl>
class __$$ProductImplCopyWithImpl<$Res>
extends _$ProductCopyWithImpl<$Res, _$ProductImpl>
implements _$$ProductImplCopyWith<$Res> {
__$$ProductImplCopyWithImpl(_$ProductImpl _value, $Res Function(_$ProductImpl) _then)
__$$ProductImplCopyWithImpl(
_$ProductImpl _value, $Res Function(_$ProductImpl) _then)
: super(_value, _then);
@pragma('vm:prefer-inline')
@@ -95,11 +93,11 @@ class __$$ProductImplCopyWithImpl<$Res> extends _$ProductCopyWithImpl<$Res, _$Pr
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
as int,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
as String,
));
}
}
@@ -151,16 +149,14 @@ class _$ProductImpl implements _Product {
abstract class _Product implements Product {
const factory _Product({required final int id, required final String name}) =
_$ProductImpl;
_$ProductImpl;
factory _Product.fromJson(Map<String, dynamic> json) = _$ProductImpl.fromJson;
@override
int get id;
@override
String get name;
@override
@JsonKey(ignore: true)
_$$ProductImplCopyWith<_$ProductImpl> get copyWith =>