flutter app untuk unitstock
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

150 lines
2.9 KiB

  1. import 'Prefs.dart';
  2. class Unit {
  3. int id;
  4. String rangka;
  5. String mesin;
  6. String kode;
  7. String tahun;
  8. String tipe;
  9. String warna;
  10. String state;
  11. String flag;
  12. String timestamp;
  13. Unit({
  14. this.id,
  15. this.rangka,
  16. this.mesin,
  17. this.kode,
  18. this.tahun,
  19. this.tipe,
  20. this.warna,
  21. this.state,
  22. this.flag,
  23. this.timestamp,
  24. });
  25. factory Unit.fromJson(Map<String, dynamic> json) {
  26. return new Unit(
  27. id: json[columnName.id],
  28. rangka: json[columnName.rangka],
  29. mesin: json[columnName.mesin],
  30. kode: json[columnName.kode],
  31. tahun: json[columnName.tahun],
  32. tipe: json[columnName.tipe],
  33. warna : json[columnName.warna],
  34. state: json[columnName.state],
  35. flag: json[columnName.flag],
  36. timestamp: json[columnName.timestamp]??''
  37. );}
  38. Map<String, dynamic> toJson() => {
  39. columnName.id: id,
  40. columnName.rangka: rangka.toUpperCase(),
  41. columnName.mesin : mesin.toUpperCase(),
  42. columnName.kode : kode.toUpperCase(),
  43. columnName.tahun : tahun,
  44. columnName.tipe: tipe,
  45. columnName.warna: warna,
  46. columnName.state :state,
  47. columnName.flag :flag,
  48. columnName.timestamp :timestamp,
  49. };
  50. }
  51. class blobImage {
  52. int blob_id;
  53. var blob_file;
  54. String mesin;
  55. String lat;
  56. String long;
  57. String jenis;
  58. String no_urut;
  59. blobImage({
  60. this.blob_id,
  61. this.blob_file,
  62. this.mesin,
  63. this.lat,
  64. this.long,
  65. this.jenis,
  66. this.no_urut
  67. });
  68. Map<String, dynamic> toJson() => {
  69. columnName.blob_id: blob_id,
  70. columnName.blob_file : blob_file,
  71. columnName.mesin : mesin,
  72. columnName.lat : lat,
  73. columnName.long : long,
  74. columnName.jenis : jenis,
  75. columnName.no_urut : no_urut
  76. };
  77. factory blobImage.fromJson(Map<String, dynamic> json) => new blobImage(
  78. blob_id: json[columnName.blob_id],
  79. blob_file: json[columnName.blob_file],
  80. mesin: json[columnName.mesin],
  81. lat: json[columnName.lat],
  82. long: json[columnName.long],
  83. jenis: json[columnName.jenis],
  84. no_urut: json[columnName.no_urut]
  85. );
  86. }
  87. class valueTab {
  88. String name;
  89. String value;
  90. valueTab({
  91. this.name,
  92. this.value
  93. });
  94. Map<String, dynamic> toJson() => {
  95. columnName.name : name,
  96. columnName.value : value,
  97. };
  98. factory valueTab.fromJson(Map<String, dynamic> json) => new valueTab(
  99. name: json[columnName.name],
  100. value: json[columnName.value],
  101. );
  102. }
  103. class jenisDrop {
  104. String value;
  105. String no_urut;
  106. jenisDrop({
  107. this.value,
  108. this.no_urut
  109. });
  110. Map<String, dynamic> toJson() => {
  111. columnName.value : value,
  112. columnName.no_urut : no_urut
  113. };
  114. factory jenisDrop.fromJson(Map<String, dynamic> json) => new jenisDrop(
  115. value: json[columnName.value],
  116. no_urut: json[columnName.no_urut]
  117. );
  118. }
  119. class Count {
  120. int count;
  121. Count({
  122. this.count,
  123. });
  124. factory Count.fromJson(Map<String, dynamic> json) => new Count(
  125. count: json["count"],
  126. );
  127. }