BudgetPerformanceHistory.fromJson constructor

BudgetPerformanceHistory.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory BudgetPerformanceHistory.fromJson(Map<String, dynamic> json) {
  return BudgetPerformanceHistory(
    budgetName: json['BudgetName'] as String?,
    budgetType: (json['BudgetType'] as String?)?.toBudgetType(),
    budgetedAndActualAmountsList:
        (json['BudgetedAndActualAmountsList'] as List?)
            ?.whereNotNull()
            .map((e) =>
                BudgetedAndActualAmounts.fromJson(e as Map<String, dynamic>))
            .toList(),
    costFilters: (json['CostFilters'] as Map<String, dynamic>?)?.map((k, e) =>
        MapEntry(
            k, (e as List).whereNotNull().map((e) => e as String).toList())),
    costTypes: json['CostTypes'] != null
        ? CostTypes.fromJson(json['CostTypes'] as Map<String, dynamic>)
        : null,
    timeUnit: (json['TimeUnit'] as String?)?.toTimeUnit(),
  );
}