DataTableConfig.fromJson constructor

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

Implementation

factory DataTableConfig.fromJson(Map<String, dynamic> json) {
  final structure = (json['structure'] as List<dynamic>)
      .map((dynamic e) => TableStructure.fromJson(e as Map<String, dynamic>))
      .toList();

  final values = (json['values'] as List<dynamic>)
      .map(
        (dynamic e) => DynamicTableModel.fromJson(e as Map<String, dynamic>),
      )
      .toList();

  return DataTableConfig(
    currentPage: json['currentPage'] as int? ?? 0,
    language: json['language'] as String? ?? '',
    perPage: json['perPage'] as int? ?? 0,
    recordCount: json['recordCount'] as int? ?? 0,
    structure: structure,
    totalPages: json['totalPages'] as int? ?? 0,
    values: values,
  );
}