workouttest_app/lib/model/customer_activity.dart
2021-05-02 17:12:42 +02:00

31 lines
734 B
Dart

import 'package:intl/intl.dart';
class CustomerActivity {
late int activityId;
late int customerId;
late String type;
late DateTime? dateAdd;
bool? skipped;
CustomerActivity.fromJson(Map json) {
activityId = json['activityId'];
customerId = json['custoemrId'];
type = json['type'];
skipped = json['skipped'];
this.dateAdd = DateTime.parse(json['dateAdd']);
}
Map<String, dynamic> toJson() => {
'activityId': this.activityId,
'customerId': this.customerId,
'type': this.type,
'skipped': this.skipped,
"dateAdd": DateFormat('yyyy-MM-dd HH:mm:ss').format(this.dateAdd!),
};
@override
String toString() {
return this.toJson().toString();
}
}