forked from eatvio/eatvio_app
added plan pagination and updated plans creation screen
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:eatvio_app/core/image_compressing/image_compress_utility.dart';
|
||||
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
|
||||
import 'package:flutter_image_compress/flutter_image_compress.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
@@ -17,21 +13,8 @@ class CreateDietModel with _$CreateDietModel {
|
||||
String? details,
|
||||
String? state,
|
||||
int? duration,
|
||||
required List<bool> type,
|
||||
required Map<String, bool> type,
|
||||
XFile? image,
|
||||
List<List<List<DailySchedule>>>? dailySchedule,
|
||||
}) = _CreateDietModel;
|
||||
|
||||
Future<Map<String, dynamic>> toCreationJson() async => {
|
||||
'name': name,
|
||||
'duration': duration,
|
||||
'state': state,
|
||||
'type': type,
|
||||
'details': details,
|
||||
'image': image != null ? await MultipartFile.fromFile((await ImageCompressUtility.compressFile(File(image!.path))).path, filename: image!.name) : null,
|
||||
};
|
||||
|
||||
Map<String, dynamic> toDailyScheduleCreationJson() => {
|
||||
'daily_schedule': dailySchedule?.map((element) => element.map((element) => element.map((element) => element.toJson()).toList()).toList()).toList(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user