Merge remote-tracking branch 'refs/remotes/origin/feature/feed'

# Conflicts:
#	lib/features/diary/presentation/pages/diary_screen.dart
This commit is contained in:
mso7nueh
2024-08-23 12:19:28 +03:00
51 changed files with 2337 additions and 529 deletions

View File

@@ -29,8 +29,12 @@ mixin _$DiaryModel {
DateTime? get wakeup => throw _privateConstructorUsedError;
DateTime? get retire => throw _privateConstructorUsedError;
/// Serializes this DiaryModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$DiaryModelCopyWith<DiaryModel> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -64,6 +68,8 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -112,6 +118,8 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel>
) as $Val);
}
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StateCopyWith<$Res> get state {
@@ -151,6 +159,8 @@ class __$$DiaryModelImplCopyWithImpl<$Res>
_$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then)
: super(_value, _then);
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -260,7 +270,7 @@ class _$DiaryModelImpl implements _DiaryModel {
(identical(other.retire, retire) || other.retire == retire));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
@@ -273,7 +283,9 @@ class _$DiaryModelImpl implements _DiaryModel {
wakeup,
retire);
@JsonKey(ignore: true)
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith =>
@@ -317,8 +329,11 @@ abstract class _DiaryModel implements DiaryModel {
DateTime? get wakeup;
@override
DateTime? get retire;
/// Create a copy of DiaryModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -28,8 +28,12 @@ mixin _$Meal {
List<Portion> get portions => throw _privateConstructorUsedError;
List<Photo> get photos => throw _privateConstructorUsedError;
/// Serializes this Meal to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of Meal
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$MealCopyWith<Meal> get copyWith => throw _privateConstructorUsedError;
}
@@ -58,6 +62,8 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Meal
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -126,6 +132,8 @@ class __$$MealImplCopyWithImpl<$Res>
__$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then)
: super(_value, _then);
/// Create a copy of Meal
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -232,7 +240,7 @@ class _$MealImpl implements _Meal {
const DeepCollectionEquality().equals(other._photos, _photos));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
@@ -244,7 +252,9 @@ class _$MealImpl implements _Meal {
const DeepCollectionEquality().hash(_portions),
const DeepCollectionEquality().hash(_photos));
@JsonKey(ignore: true)
/// Create a copy of Meal
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$MealImplCopyWith<_$MealImpl> get copyWith =>
@@ -284,8 +294,11 @@ abstract class _Meal implements Meal {
List<Portion> get portions;
@override
List<Photo> get photos;
/// Create a copy of Meal
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$MealImplCopyWith<_$MealImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -25,8 +25,12 @@ mixin _$Photo {
String get originalName => throw _privateConstructorUsedError;
String get path => throw _privateConstructorUsedError;
/// Serializes this Photo to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of Photo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PhotoCopyWith<Photo> get copyWith => throw _privateConstructorUsedError;
}
@@ -51,6 +55,8 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Photo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -96,6 +102,8 @@ class __$$PhotoImplCopyWithImpl<$Res>
_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then)
: super(_value, _then);
/// Create a copy of Photo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -155,11 +163,13 @@ class _$PhotoImpl implements _Photo {
(identical(other.path, path) || other.path == path));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, originalName, path);
@JsonKey(ignore: true)
/// Create a copy of Photo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PhotoImplCopyWith<_$PhotoImpl> get copyWith =>
@@ -188,8 +198,11 @@ abstract class _Photo implements Photo {
String get originalName;
@override
String get path;
/// Create a copy of Photo
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PhotoImplCopyWith<_$PhotoImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -26,8 +26,12 @@ mixin _$Portion {
String get portion => throw _privateConstructorUsedError;
bool get from_diet => throw _privateConstructorUsedError;
/// Serializes this Portion to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of Portion
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PortionCopyWith<Portion> get copyWith => throw _privateConstructorUsedError;
}
@@ -54,6 +58,8 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Portion
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -111,6 +117,8 @@ class __$$PortionImplCopyWithImpl<$Res>
_$PortionImpl _value, $Res Function(_$PortionImpl) _then)
: super(_value, _then);
/// Create a copy of Portion
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -189,12 +197,14 @@ class _$PortionImpl implements _Portion {
other.from_diet == from_diet));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, id, product_name, quantity, portion, from_diet);
@JsonKey(ignore: true)
/// Create a copy of Portion
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PortionImplCopyWith<_$PortionImpl> get copyWith =>
@@ -228,8 +238,11 @@ abstract class _Portion implements Portion {
String get portion;
@override
bool get from_diet;
/// Create a copy of Portion
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PortionImplCopyWith<_$PortionImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -23,8 +23,12 @@ mixin _$Product {
int get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
/// Serializes this Product to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of Product
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ProductCopyWith<Product> get copyWith => throw _privateConstructorUsedError;
}
@@ -46,6 +50,8 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Product
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -83,6 +89,8 @@ class __$$ProductImplCopyWithImpl<$Res>
_$ProductImpl _value, $Res Function(_$ProductImpl) _then)
: super(_value, _then);
/// Create a copy of Product
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -129,11 +137,13 @@ class _$ProductImpl implements _Product {
(identical(other.name, name) || other.name == name));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, name);
@JsonKey(ignore: true)
/// Create a copy of Product
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ProductImplCopyWith<_$ProductImpl> get copyWith =>
@@ -157,8 +167,11 @@ abstract class _Product implements Product {
int get id;
@override
String get name;
/// Create a copy of Product
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ProductImplCopyWith<_$ProductImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -23,8 +23,12 @@ mixin _$State {
bool get has_chosen_diet => throw _privateConstructorUsedError;
bool get has_chosen_plan => throw _privateConstructorUsedError;
/// Serializes this State to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
/// Create a copy of State
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$StateCopyWith<State> get copyWith => throw _privateConstructorUsedError;
}
@@ -46,6 +50,8 @@ class _$StateCopyWithImpl<$Res, $Val extends State>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of State
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -83,6 +89,8 @@ class __$$StateImplCopyWithImpl<$Res>
_$StateImpl _value, $Res Function(_$StateImpl) _then)
: super(_value, _then);
/// Create a copy of State
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -132,12 +140,14 @@ class _$StateImpl implements _State {
other.has_chosen_plan == has_chosen_plan));
}
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, has_chosen_diet, has_chosen_plan);
@JsonKey(ignore: true)
/// Create a copy of State
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$StateImplCopyWith<_$StateImpl> get copyWith =>
@@ -162,8 +172,11 @@ abstract class _State implements State {
bool get has_chosen_diet;
@override
bool get has_chosen_plan;
/// Create a copy of State
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$StateImplCopyWith<_$StateImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -174,6 +174,9 @@ class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -190,6 +193,9 @@ class __$$DiaryStateImplCopyWithImpl<$Res>
__$$DiaryStateImplCopyWithImpl(
_$DiaryStateImpl _value, $Res Function(_$DiaryStateImpl) _then)
: super(_value, _then);
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -397,6 +403,8 @@ class __$$DiaryStateLoadingImplCopyWithImpl<$Res>
$Res Function(_$DiaryStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -435,7 +443,9 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading {
@override
int get hashCode => Object.hash(runtimeType, id);
@JsonKey(ignore: true)
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith =>
@@ -611,7 +621,10 @@ abstract class DiaryStateLoading implements DiaryState {
const factory DiaryStateLoading({final int? id}) = _$DiaryStateLoadingImpl;
int? get id;
@JsonKey(ignore: true)
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -666,6 +679,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
$Res Function(_$DiaryStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -819,6 +834,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
));
}
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DiaryModelCopyWith<$Res> get diary {
@@ -827,6 +844,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
});
}
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$MealCopyWith<$Res> get currentMeal {
@@ -835,6 +854,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
});
}
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SelectionPopupModelCopyWith<$Res> get portionController {
@@ -1100,7 +1121,9 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded {
const DeepCollectionEquality().hash(_chartDataCounted)
]);
@JsonKey(ignore: true)
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith =>
@@ -1420,7 +1443,10 @@ abstract class DiaryStateLoaded implements DiaryState {
bool get isLoading;
bool get isAdded;
List<NutritionData>? get chartDataCounted;
@JsonKey(ignore: true)
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -1442,6 +1468,8 @@ class __$$DiaryStateErrorImplCopyWithImpl<$Res>
_$DiaryStateErrorImpl _value, $Res Function(_$DiaryStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -1481,7 +1509,9 @@ class _$DiaryStateErrorImpl implements DiaryStateError {
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
@JsonKey(ignore: true)
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith =>
@@ -1658,7 +1688,10 @@ abstract class DiaryStateError implements DiaryState {
_$DiaryStateErrorImpl;
String get errorMessage;
@JsonKey(ignore: true)
/// Create a copy of DiaryState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -18,9 +18,8 @@ import 'package:flutter/services.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:image_picker/image_picker.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
// import 'package:syncfusion_flutter_charts/charts.dart';
// ignore: must_be_immutable
class DiaryScreen extends StatelessWidget {
final String? diaryID;
@@ -137,29 +136,30 @@ class DiaryScreen extends StatelessWidget {
Text(
"от дневной суточной нормы",
),
Transform.rotate(
angle: -1.5708,
child: ClipRect(
child: Align(
alignment: Alignment.centerRight,
widthFactor: 0.5,
child: SfCircularChart(
series: <CircularSeries>[
RadialBarSeries<NutritionData, String>(
dataSource: state.chartDataCounted,
xValueMapper: (NutritionData data, _) => data.category,
yValueMapper: (NutritionData data, _) => data.nutrition,
pointColorMapper: (NutritionData data, _) => data.color,
trackColor: Color.fromRGBO(59, 130, 246, 1),
trackOpacity: 0.1,
gap: "8%",
radius: "110%",
innerRadius: '20%', // Измените значение по вашему усмотрению
),
],
),
),
)),
// Transform.rotate(
// angle: -1.5708,
// child: ClipRect(
// child: Align(
// alignment: Alignment.centerRight,
// widthFactor: 0.5,
// child: SfCircularChart(
// series: <CircularSeries>[
// RadialBarSeries<NutritionData, String>(
// dataSource: state.chartDataCounted,
// xValueMapper: (NutritionData data, _) => data.category,
// yValueMapper: (NutritionData data, _) => data.nutrition,
// pointColorMapper: (NutritionData data, _) => data.color,
// trackColor: Color.fromRGBO(59, 130, 246, 1),
// trackOpacity: 0.1,
// gap: "8%",
// radius: "110%",
// innerRadius: '20%', // Измените значение по вашему усмотрению
// )
// ],
// ),
// ),
// ),
// ),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [