Files
GSFV2/gsf/lib/modals/user_dashboard_chart_model.dart
2024-04-10 12:51:20 +05:30

36 lines
986 B
Dart

class UserDashboardChartModel {
bool success;
String message;
List<MonthLyPosition> monthlyData;
UserDashboardChartModel({
required this.message,
required this.success,
required this.monthlyData,
});
factory UserDashboardChartModel.fromJson(Map<String, dynamic>json) {
var monthlyPositionsData = json['monthly_positions'] as List;
List<MonthLyPosition> monthlyPositionsList =
monthlyPositionsData.map((data) => MonthLyPosition.fromJson(data)).toList();
return UserDashboardChartModel(
message: json["message"],
success: json["success"],
monthlyData: monthlyPositionsList,
);
}
}
class MonthLyPosition {
dynamic position;
String month;
MonthLyPosition({
required this.month,
this.position,
});
factory MonthLyPosition.fromJson(Map<String, dynamic> json) {
return MonthLyPosition(
month: json["month"],
position: json["position"] == null?null:json['position'].toDouble(),
);
}
}