create static method

MemoryData create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "memoryData",
  3. num? mem_total,
  4. num? mem_free,
  5. num? mem_available,
  6. num? buffers,
  7. num? cached,
  8. num? swap_cached,
  9. num? active,
  10. num? inactive,
  11. num? active_anon,
  12. num? inactive_anon,
  13. num? active_file,
  14. num? inactive_file,
  15. num? unevictable,
  16. num? mlocked,
  17. num? swap_total,
  18. num? swap_free,
  19. num? zswap,
  20. num? zswapped,
  21. num? dirty,
  22. num? writeback,
  23. num? anon_pages,
  24. num? mapped,
  25. num? shmem,
  26. num? k_reclaimable,
  27. num? slab,
  28. num? s_reclaimable,
  29. num? s_unreclaim,
  30. num? kernel_stack,
  31. num? page_tables,
  32. num? sec_page_tables,
  33. num? n_f_s_unstable,
  34. num? bounce,
  35. num? writeback_tmp,
  36. num? commit_limit,
  37. num? committed_a_s,
  38. num? vmalloc_total,
  39. num? vmalloc_used,
  40. num? vmalloc_chunk,
  41. num? percpu,
  42. num? hardware_corrupted,
  43. num? anon_huge_pages,
  44. num? shmem_huge_pages,
  45. num? shmem_pmd_mapped,
  46. num? file_huge_pages,
  47. num? file_pmd_mapped,
  48. num? unaccepted,
  49. num? huge_pages_total,
  50. num? huge_pages_free,
  51. num? huge_pages_rsvd,
  52. num? huge_pages_surp,
  53. num? hugepagesize,
  54. num? hugetlb,
  55. num? direct_map4k,
  56. num? direct_map2_m,
  57. num? direct_map1_g,
})
override

return original data json

Implementation

static MemoryData create({
            bool schemeUtilsIsSetDefaultData = false,

  String special_type = "memoryData",
  num? mem_total,
  num? mem_free,
  num? mem_available,
  num? buffers,
  num? cached,
  num? swap_cached,
  num? active,
  num? inactive,
  num? active_anon,
  num? inactive_anon,
  num? active_file,
  num? inactive_file,
  num? unevictable,
  num? mlocked,
  num? swap_total,
  num? swap_free,
  num? zswap,
  num? zswapped,
  num? dirty,
  num? writeback,
  num? anon_pages,
  num? mapped,
  num? shmem,
  num? k_reclaimable,
  num? slab,
  num? s_reclaimable,
  num? s_unreclaim,
  num? kernel_stack,
  num? page_tables,
  num? sec_page_tables,
  num? n_f_s_unstable,
  num? bounce,
  num? writeback_tmp,
  num? commit_limit,
  num? committed_a_s,
  num? vmalloc_total,
  num? vmalloc_used,
  num? vmalloc_chunk,
  num? percpu,
  num? hardware_corrupted,
  num? anon_huge_pages,
  num? shmem_huge_pages,
  num? shmem_pmd_mapped,
  num? file_huge_pages,
  num? file_pmd_mapped,
  num? unaccepted,
  num? huge_pages_total,
  num? huge_pages_free,
  num? huge_pages_rsvd,
  num? huge_pages_surp,
  num? hugepagesize,
  num? hugetlb,
  num? direct_map4k,
  num? direct_map2_m,
  num? direct_map1_g,
})  {
  // MemoryData memoryData = MemoryData({
final Map memoryData_data_create_json = {

    "@type": special_type,
    "mem_total": mem_total,
    "mem_free": mem_free,
    "mem_available": mem_available,
    "buffers": buffers,
    "cached": cached,
    "swap_cached": swap_cached,
    "active": active,
    "inactive": inactive,
    "active_anon": active_anon,
    "inactive_anon": inactive_anon,
    "active_file": active_file,
    "inactive_file": inactive_file,
    "unevictable": unevictable,
    "mlocked": mlocked,
    "swap_total": swap_total,
    "swap_free": swap_free,
    "zswap": zswap,
    "zswapped": zswapped,
    "dirty": dirty,
    "writeback": writeback,
    "anon_pages": anon_pages,
    "mapped": mapped,
    "shmem": shmem,
    "k_reclaimable": k_reclaimable,
    "slab": slab,
    "s_reclaimable": s_reclaimable,
    "s_unreclaim": s_unreclaim,
    "kernel_stack": kernel_stack,
    "page_tables": page_tables,
    "sec_page_tables": sec_page_tables,
    "n_f_s_unstable": n_f_s_unstable,
    "bounce": bounce,
    "writeback_tmp": writeback_tmp,
    "commit_limit": commit_limit,
    "committed_a_s": committed_a_s,
    "vmalloc_total": vmalloc_total,
    "vmalloc_used": vmalloc_used,
    "vmalloc_chunk": vmalloc_chunk,
    "percpu": percpu,
    "hardware_corrupted": hardware_corrupted,
    "anon_huge_pages": anon_huge_pages,
    "shmem_huge_pages": shmem_huge_pages,
    "shmem_pmd_mapped": shmem_pmd_mapped,
    "file_huge_pages": file_huge_pages,
    "file_pmd_mapped": file_pmd_mapped,
    "unaccepted": unaccepted,
    "huge_pages_total": huge_pages_total,
    "huge_pages_free": huge_pages_free,
    "huge_pages_rsvd": huge_pages_rsvd,
    "huge_pages_surp": huge_pages_surp,
    "hugepagesize": hugepagesize,
    "hugetlb": hugetlb,
    "direct_map4k": direct_map4k,
    "direct_map2_m": direct_map2_m,
    "direct_map1_g": direct_map1_g,


};


        memoryData_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (memoryData_data_create_json.containsKey(key) == false) {
        memoryData_data_create_json[key] = value;
      }
    });
  }
return MemoryData(memoryData_data_create_json);


    }