forked from eatvio/eatvio_app
diet creation scrren is done
This commit is contained in:
@@ -7,11 +7,14 @@ class CreateDietRepository {
|
||||
final CreateDietService createDietService;
|
||||
CreateDietRepository({required this.createDietService});
|
||||
|
||||
Future<Diet> createDiet({
|
||||
String? name,
|
||||
int? duration,
|
||||
String? state,
|
||||
String? type,
|
||||
Future<CreatedDiet> createDiet({
|
||||
String? name,
|
||||
int? duration,
|
||||
String? state,
|
||||
String? meatType,
|
||||
String? carbType,
|
||||
String? vegType,
|
||||
String? lightType,
|
||||
String? details,
|
||||
File? image,
|
||||
}) {
|
||||
@@ -19,7 +22,10 @@ class CreateDietRepository {
|
||||
name: name,
|
||||
duration: duration,
|
||||
state: state,
|
||||
type: type,
|
||||
meatType: meatType,
|
||||
carbType: carbType,
|
||||
vegType: vegType,
|
||||
lightType: lightType,
|
||||
details: details,
|
||||
image: image,
|
||||
);
|
||||
@@ -29,9 +35,13 @@ class CreateDietRepository {
|
||||
required int id,
|
||||
required Map<String, dynamic> model,
|
||||
}) {
|
||||
return createDietService.createDietDailySchedule(
|
||||
id: id,
|
||||
model: model,
|
||||
);
|
||||
try {
|
||||
return createDietService.createDietDailySchedule(
|
||||
id: id,
|
||||
model: model,
|
||||
);
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user