chnages has been made and net salary is being displayed
This commit is contained in:
36
lib/data/dto/salary_response_dto.dart
Normal file
36
lib/data/dto/salary_response_dto.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
class SalaryResponseDto {
|
||||
final bool isSuccess;
|
||||
final String message;
|
||||
final SalaryDataDto? data;
|
||||
|
||||
SalaryResponseDto({
|
||||
required this.isSuccess,
|
||||
required this.message,
|
||||
this.data,
|
||||
});
|
||||
|
||||
factory SalaryResponseDto.fromJson(Map<String, dynamic> json) {
|
||||
return SalaryResponseDto(
|
||||
isSuccess: json['isSuccess'] ?? json['IsSuccess'] ?? false,
|
||||
message: json['message'] ?? json['Message'] ?? '',
|
||||
data:
|
||||
json['data'] != null
|
||||
? SalaryDataDto.fromJson(json['data'])
|
||||
: json['Data'] != null
|
||||
? SalaryDataDto.fromJson(json['Data'])
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SalaryDataDto {
|
||||
final double netAmount;
|
||||
|
||||
SalaryDataDto({required this.netAmount});
|
||||
|
||||
factory SalaryDataDto.fromJson(Map<String, dynamic> json) {
|
||||
return SalaryDataDto(
|
||||
netAmount: (json['netAmount'] ?? json['NetAmount'] ?? 0.0).toDouble(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user