import 'Vehicle.dart'; class DriverSummary { int totalDuration; double totalEarnings; int totalSessions; int totalRidesCanceled; int totalRidesCompleted; double beemEarnings; double driverEarnings; DriverSummary({ required this.totalDuration, required this.totalEarnings, required this.totalSessions, required this.totalRidesCanceled, required this.totalRidesCompleted, required this.beemEarnings, required this.driverEarnings, }); factory DriverSummary.fromJson(Map json) { return DriverSummary( totalDuration: json['totalDuration']??0, totalEarnings: json['totalEarnings']??0, totalSessions: json['totalSessions']??0, totalRidesCanceled: json['totalRidesCanceled']??0, totalRidesCompleted: json['totalRidesCompleted']??0, beemEarnings: json['beemEarnings']??0, driverEarnings: json['driverEarnings']??0, ); } Map toJson() { return { 'totalDuration': totalDuration, 'totalEarnings': totalEarnings, 'totalSessions': totalSessions, 'totalRidesCanceled': totalRidesCanceled, 'totalRidesCompleted': totalRidesCompleted, 'beemEarnings': beemEarnings, 'driverEarnings': driverEarnings, }; } }