36 lines
944 B
Dart
36 lines
944 B
Dart
import 'package:intl/intl.dart';
|
|
|
|
class Exercise {
|
|
int exerciseId;
|
|
int exerciseTypeId;
|
|
int customerId;
|
|
double quantity;
|
|
String unit;
|
|
double unitQuantity;
|
|
DateTime dateAdd;
|
|
int exercisePlanDetailId;
|
|
|
|
|
|
|
|
Exercise({this.exerciseTypeId, this.customerId, this.quantity, this.dateAdd});
|
|
|
|
Exercise.fromJson(Map json) {
|
|
this.exerciseTypeId = json['exerciseTypeId'];
|
|
this.customerId = json['customerId'];
|
|
this.quantity = json['quantity'];
|
|
this.unit = json['unit'];
|
|
this.unitQuantity = json['unitQuantity'];
|
|
this.dateAdd = DateTime.parse( json['dateAdd'] );
|
|
}
|
|
|
|
Map<String, dynamic> toJson() =>
|
|
{
|
|
"exerciseTypeId": exerciseTypeId,
|
|
"customerId": customerId,
|
|
"quantity": quantity,
|
|
"unit": unit,
|
|
"unitQuantity": unitQuantity,
|
|
"dateAdd": DateFormat('yyyy-MM-dd HH:mm:ss').format(this.dateAdd),
|
|
"exercisePlanDetailId": exercisePlanDetailId,
|
|
};
|
|
} |