import '../app/app.locator.dart'; import '../services/other_function.dart'; class DataModel { final _myFunction = locator(); int? no; String? waterHeight; int? status; String? createdAt; DataModel({this.no, this.waterHeight, this.status, this.createdAt}); DataModel.fromJson(Map json) { no = json['no']; waterHeight = json['water_height']; status = json['status']; createdAt = _myFunction.formatDateString2(json['created_at']); } Map toJson() { final Map data = {}; data['no'] = no; data['water_height'] = waterHeight; data['status'] = status; data['created_at'] = createdAt; return data; } }