flutter app untuk unitstock
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

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