Compare commits

...

9 Commits

Author SHA1 Message Date
misha
4c38026748 Merge remote-tracking branch 'upstream/main' 2026-10-19 12:50:07 +03:00
04195dd95b Merge pull request 'bump version for TF' (#1082) from apoloz/eatvio_app:main into main
Reviewed-on: eatvio/eatvio_app#1082
2026-10-19 07:55:43 +00:00
Anatoliy Poloz
d3336b1263 bump version for TF 2026-10-19 10:48:32 +03:00
82f5c9a7fe Merge pull request 'fix(diary): parse commented_from_diet/reviewed_from_diet portion states, fallback unknown states to PortionState.unknown' (#1081) from apoloz/eatvio_app:main into main
Reviewed-on: eatvio/eatvio_app#1081
Reviewed-by: misha <misha@noreply.localhost>
2026-10-19 07:32:51 +00:00
Anatoliy Poloz
39a512193e fix(diary): parse commented_from_diet/reviewed_from_diet portion states, fallback unknown states to PortionState.unknown 2026-10-16 21:12:40 +03:00
4dc5839317 Merge pull request 'feat(video_calls): android repeated call after hanging up fix and ios repeated calls after call initiation fix' (#1079) from misha/eatvio_app:main into main
Reviewed-on: eatvio/eatvio_app#1079
2026-10-16 15:21:13 +00:00
60080c7407 Merge pull request 'feat(video_calls): ios voip push, mix and crushes fix' (#1078) from misha/eatvio_app:main into main
Reviewed-on: eatvio/eatvio_app#1078
2026-10-16 10:57:37 +00:00
293601f1e1 Merge pull request 'feat(ios): env migration for ios 27' (#1077) from misha/eatvio_app:main into main
Reviewed-on: eatvio/eatvio_app#1077
2026-10-16 05:27:39 +00:00
6a259e5452 Merge pull request 'feat(video_calls): ios mic fix, android call fix. feat(dev_tools): base url caching' (#1076) from misha/eatvio_app:main into main
Reviewed-on: eatvio/eatvio_app#1076
Reviewed-by: Анатолий Полоз <t0ly.od@ya.ru>
2026-10-15 13:32:29 +00:00
3 changed files with 52 additions and 13 deletions

View File

@@ -18,8 +18,13 @@ enum PortionState {
@JsonValue('eaten_edited')
eatenEdited,
commented,
@JsonValue('commented_from_diet')
commentedFromDiet,
@JsonValue('reviewed_by_user')
reviewedByUser,
@JsonValue('reviewed_from_diet')
reviewedFromDiet,
unknown,
}
@freezed
@@ -138,7 +143,7 @@ abstract class PortionModel with _$PortionModel {
@JsonKey(name: "quantity") required int quantity,
@JsonKey(name: "portion") required String portion,
@JsonKey(name: "from_diet") required bool fromDiet,
@JsonKey(name: "state") required PortionState portionState,
@JsonKey(name: "state", unknownEnumValue: PortionState.unknown) required PortionState portionState,
}) = _PortionModel;
factory PortionModel.fromJson(Map<String, dynamic> json) => _$PortionModelFromJson(json);

View File

@@ -1,6 +1,6 @@
name: eatvio_app
description: A new Flutter project.
version: 1.3.56+145
version: 1.3.57+146
publish_to: 'none'
environment:
@@ -175,14 +175,14 @@ flutter_intl:
flutter_native_splash:
android: true
ios: true
color: '#FFFFFF'
image_android: 'assets/splash/splash.png'
image_dark_android: 'assets/splash/splash.png'
image_ios: 'assets/splash/splash.png'
image_dark_ios: 'assets/splash/splash.png'
branding_android: 'assets/splash/branding.png'
branding_dark_android: 'assets/splash/branding.png'
color: "#FFFFFF"
image_android: "assets/splash/splash.png"
image_dark_android: "assets/splash/splash.png"
image_ios: "assets/splash/splash.png"
image_dark_ios: "assets/splash/splash.png"
branding_android: "assets/splash/branding.png"
branding_dark_android: "assets/splash/branding.png"
android_12:
image: 'assets/splash/splash.png'
image_dark: 'assets/splash/splash.png'
branding: 'assets/splash/branding.png'
image: "assets/splash/splash.png"
image_dark: "assets/splash/splash.png"
branding: "assets/splash/branding.png"

View File

@@ -4,14 +4,48 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
group('PortionState enum', () {
test('has all expected values', () {
expect(PortionState.values.length, 7);
expect(PortionState.values.length, 10);
expect(PortionState.filledDiet, isNotNull);
expect(PortionState.eatenFromDiet, isNotNull);
expect(PortionState.eaten, isNotNull);
expect(PortionState.eatenDeleted, isNotNull);
expect(PortionState.eatenEdited, isNotNull);
expect(PortionState.commented, isNotNull);
expect(PortionState.commentedFromDiet, isNotNull);
expect(PortionState.reviewedByUser, isNotNull);
expect(PortionState.reviewedFromDiet, isNotNull);
expect(PortionState.unknown, isNotNull);
});
});
group('PortionModel.fromJson', () {
Map<String, dynamic> portionJson({required String state}) => {
'id': 1,
'product_nutritional_value_id': null,
'product_calories_info': null,
'product_name': 'Oatmeal',
'quantity': 1,
'portion': '100g',
'from_diet': true,
'state': state,
};
test('parses commented_from_diet state', () {
final model = PortionModel.fromJson(portionJson(state: 'commented_from_diet'));
expect(model.portionState, PortionState.commentedFromDiet);
});
test('parses reviewed_from_diet state', () {
final model = PortionModel.fromJson(portionJson(state: 'reviewed_from_diet'));
expect(model.portionState, PortionState.reviewedFromDiet);
});
test('does not throw on unknown state from backend', () {
final model = PortionModel.fromJson(portionJson(state: 'some_future_state'));
expect(model.portionState, PortionState.unknown);
});
});