Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.87 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:http/http.dart' as http;
  3. import 'dart:async';
  4. import 'dart:convert';
  5. import '../modelHttp/datahasiluji/JsonAPIhasiluji.dart';
  6.  
  7. class ListDataPage extends StatefulWidget {
  8. static String tag = 'listdatahasiluji-page';
  9. @override
  10. _ListDataPageState createState() => _ListDataPageState();
  11. }
  12.  
  13. class _ListDataPageState extends State<ListDataPage> {
  14. Future<ListModel> getDataHasilUji() async {
  15. final response = await http
  16. .get("http://192.168.5.33:8080/dishub/wscekkendaraan/datauji?no=${no}");
  17. return ListModel.fromJson(json.decode(response.body));
  18. }
  19.  
  20. @override
  21. Widget build(BuildContext context) {
  22. return Scaffold(
  23. body: new FutureBuilder<ListModel>(
  24. future: getDataHasilUji(),
  25. builder: (context, snapshot) {
  26. if (snapshot.hasError) print(snapshot.error);
  27. return snapshot.hasData
  28. ? new ItemList(
  29. list: snapshot.data,
  30. )
  31. : new Center(
  32. child: new CircularProgressIndicator(),
  33. );
  34. },
  35. ),
  36. appBar: AppBar(
  37. leading: IconButton(
  38. icon: Icon(Icons.arrow_back_ios),
  39. onPressed: () {
  40. Navigator.of(context).pop();
  41. }),
  42. iconTheme: IconThemeData(
  43. color: Colors.white, //change your color here
  44. ),
  45. title: Text("Data Hasil Uji Kendaraan"),
  46. ),
  47. );
  48. }
  49. }
  50.  
  51. class ItemList extends StatelessWidget {
  52. final ListModel list;
  53. ItemList({this.list});
  54.  
  55. @override
  56. Widget build(BuildContext context) {
  57. return Material(
  58. child: ListView.builder(
  59. itemCount: list == null ? 0 : list.result.data.length,
  60. itemBuilder: (BuildContext context, int index) {
  61. return Scaffold(
  62. body: Stack(
  63. children: <Widget>[
  64. Container(
  65. decoration: BoxDecoration(
  66. image: DecorationImage(
  67. image: AssetImage("assets/img/logopolantas.png"),
  68. fit: BoxFit.fitWidth)),
  69. ),
  70. ListView(
  71. padding: EdgeInsets.only(left: 10.0, top: 10.0),
  72. children: <Widget>[
  73. Text(
  74. 'No. Uji',
  75. style: TextStyle(
  76. fontWeight: FontWeight.bold,
  77. fontSize: 16,
  78. color: Colors.red),
  79. ),
  80. SizedBox(height: 6),
  81. Text(
  82. list.result.data[index].noUji,
  83. style: TextStyle(
  84. fontSize: 15.0, fontWeight: FontWeight.bold),
  85. ),
  86. SizedBox(height: 15),
  87. Text(
  88. 'Nama Pemilik',
  89. style: TextStyle(
  90. fontWeight: FontWeight.bold,
  91. fontSize: 16,
  92. color: Colors.red),
  93. ),
  94. SizedBox(height: 6),
  95. Text(
  96. '',
  97. style: TextStyle(
  98. fontSize: 15.0, fontWeight: FontWeight.bold),
  99. ),
  100. SizedBox(height: 15),
  101. Text(
  102. 'Alamat Pemilik',
  103. style: TextStyle(
  104. fontWeight: FontWeight.bold,
  105. fontSize: 16,
  106. color: Colors.red),
  107. ),
  108. SizedBox(height: 6),
  109. Text(
  110. 'KARANGNANAS,Karangnanas Kec. Sokaraja Kab. Banyumas',
  111. style: TextStyle(
  112. fontSize: 15.0, fontWeight: FontWeight.bold),
  113. ),
  114. SizedBox(height: 15),
  115. Text(
  116. 'No. Sertifikat Registrasi',
  117. style: TextStyle(
  118. fontWeight: FontWeight.bold,
  119. fontSize: 16,
  120. color: Colors.red),
  121. ),
  122. SizedBox(height: 6),
  123. Text(
  124. '045633/SM-SRUT/DRJD-SPD/XII/2018',
  125. style: TextStyle(
  126. fontSize: 15.0, fontWeight: FontWeight.bold),
  127. ),
  128. SizedBox(height: 15),
  129. Text(
  130. 'Tgl. Sertifikat Registrasi',
  131. style: TextStyle(
  132. fontWeight: FontWeight.bold,
  133. fontSize: 16,
  134. color: Colors.red),
  135. ),
  136. SizedBox(height: 6),
  137. Text(
  138. '11-12-2018',
  139. style: TextStyle(
  140. fontSize: 15.0, fontWeight: FontWeight.bold),
  141. ),
  142. SizedBox(height: 15),
  143. Text(
  144. 'No. Registrasi Kendaraan',
  145. style: TextStyle(
  146. fontWeight: FontWeight.bold,
  147. fontSize: 16,
  148. color: Colors.red),
  149. ),
  150. SizedBox(height: 6),
  151. Text(
  152. 'R 1542 YA',
  153. style: TextStyle(
  154. fontSize: 15.0, fontWeight: FontWeight.bold),
  155. ),
  156. SizedBox(height: 15),
  157. Text(
  158. 'No. Rangka',
  159. style: TextStyle(
  160. fontWeight: FontWeight.bold,
  161. fontSize: 16,
  162. color: Colors.red),
  163. ),
  164. SizedBox(height: 6),
  165. Text(
  166. 'MJEC1JG4315169507',
  167. style: TextStyle(
  168. fontSize: 15.0, fontWeight: FontWeight.bold),
  169. ),
  170. SizedBox(height: 15),
  171. Text(
  172. 'No. Mesin',
  173. style: TextStyle(
  174. fontWeight: FontWeight.bold,
  175. fontSize: 16,
  176. color: Colors.red),
  177. ),
  178. SizedBox(height: 6),
  179. Text(
  180. 'W04DTRR59428',
  181. style: TextStyle(
  182. fontSize: 15.0, fontWeight: FontWeight.bold),
  183. ),
  184. SizedBox(height: 15),
  185. Text(
  186. 'Merek',
  187. style: TextStyle(
  188. fontWeight: FontWeight.bold,
  189. fontSize: 16,
  190. color: Colors.red),
  191. ),
  192. SizedBox(height: 6),
  193. Text(
  194. 'HINO',
  195. style: TextStyle(
  196. fontSize: 15.0, fontWeight: FontWeight.bold),
  197. ),
  198. SizedBox(height: 15),
  199. Text(
  200. 'Tipe',
  201. style: TextStyle(
  202. fontWeight: FontWeight.bold,
  203. fontSize: 16,
  204. color: Colors.red),
  205. ),
  206. SizedBox(height: 6),
  207. Text(
  208. 'WU342R',
  209. style: TextStyle(
  210. fontSize: 15.0, fontWeight: FontWeight.bold),
  211. ),
  212. SizedBox(height: 15),
  213. Text(
  214. 'Jenis',
  215. style: TextStyle(
  216. fontWeight: FontWeight.bold,
  217. fontSize: 16,
  218. color: Colors.red),
  219. ),
  220. SizedBox(height: 6),
  221. Text(
  222. 'MOBIL BARANG BAK TERBUKA',
  223. style: TextStyle(
  224. fontSize: 15.0, fontWeight: FontWeight.bold),
  225. ),
  226. SizedBox(height: 15),
  227. Text(
  228. 'Tahun Pembuatan',
  229. style: TextStyle(
  230. fontWeight: FontWeight.bold,
  231. fontSize: 16,
  232. color: Colors.red),
  233. ),
  234. SizedBox(height: 6),
  235. Text(
  236. '2018',
  237. style: TextStyle(
  238. fontSize: 15.0, fontWeight: FontWeight.bold),
  239. ),
  240. SizedBox(height: 15),
  241. Text(
  242. 'Bahan Bakar',
  243. style: TextStyle(
  244. fontWeight: FontWeight.bold,
  245. fontSize: 16,
  246. color: Colors.red),
  247. ),
  248. SizedBox(height: 6),
  249. Text(
  250. 'SOLAR',
  251. style: TextStyle(
  252. fontSize: 15.0, fontWeight: FontWeight.bold),
  253. ),
  254. SizedBox(height: 15),
  255. Text(
  256. 'Isi Silinder',
  257. style: TextStyle(
  258. fontWeight: FontWeight.bold,
  259. fontSize: 16,
  260. color: Colors.red),
  261. ),
  262. SizedBox(height: 6),
  263. Text(
  264. '4009',
  265. style: TextStyle(
  266. fontSize: 15.0, fontWeight: FontWeight.bold),
  267. ),
  268. SizedBox(height: 15),
  269. Text(
  270. 'Daya Motor Penggerak',
  271. style: TextStyle(
  272. fontWeight: FontWeight.bold,
  273. fontSize: 16,
  274. color: Colors.red),
  275. ),
  276. SizedBox(height: 6),
  277. Text(
  278. '96',
  279. style: TextStyle(
  280. fontSize: 15.0, fontWeight: FontWeight.bold),
  281. ),
  282. SizedBox(height: 15),
  283. Text(
  284. 'JBB',
  285. style: TextStyle(
  286. fontWeight: FontWeight.bold,
  287. fontSize: 16,
  288. color: Colors.red),
  289. ),
  290. SizedBox(height: 6),
  291. Text(
  292. '8250',
  293. style: TextStyle(
  294. fontSize: 15.0, fontWeight: FontWeight.bold),
  295. ),
  296. SizedBox(height: 15),
  297. Text(
  298. 'JBKB',
  299. style: TextStyle(
  300. fontWeight: FontWeight.bold,
  301. fontSize: 16,
  302. color: Colors.red),
  303. ),
  304. SizedBox(height: 6),
  305. Text(
  306. '0',
  307. style: TextStyle(
  308. fontSize: 15.0, fontWeight: FontWeight.bold),
  309. ),
  310. SizedBox(height: 15),
  311. Text(
  312. 'JBI',
  313. style: TextStyle(
  314. fontWeight: FontWeight.bold,
  315. fontSize: 16,
  316. color: Colors.red),
  317. ),
  318. SizedBox(height: 6),
  319. Text(
  320. '8166',
  321. style: TextStyle(
  322. fontSize: 15.0, fontWeight: FontWeight.bold),
  323. ),
  324. SizedBox(height: 15),
  325. Text(
  326. 'JBKI',
  327. style: TextStyle(
  328. fontWeight: FontWeight.bold,
  329. fontSize: 16,
  330. color: Colors.red),
  331. ),
  332. SizedBox(height: 6),
  333. Text(
  334. '0',
  335. style: TextStyle(
  336. fontSize: 15.0, fontWeight: FontWeight.bold),
  337. ),
  338. SizedBox(height: 15),
  339. Text(
  340. 'MST',
  341. style: TextStyle(
  342. fontWeight: FontWeight.bold,
  343. fontSize: 16,
  344. color: Colors.red),
  345. ),
  346. SizedBox(height: 6),
  347. Text(
  348. '5280',
  349. style: TextStyle(
  350. fontSize: 15.0, fontWeight: FontWeight.bold),
  351. ),
  352. SizedBox(height: 15),
  353. Text(
  354. 'Berat Kosong',
  355. style: TextStyle(
  356. fontWeight: FontWeight.bold,
  357. fontSize: 16,
  358. color: Colors.red),
  359. ),
  360. SizedBox(height: 6),
  361. Text(
  362. '4046',
  363. style: TextStyle(
  364. fontSize: 15.0, fontWeight: FontWeight.bold),
  365. ),
  366. SizedBox(height: 15),
  367. Text(
  368. 'Konfigurasi Sumbu Roda',
  369. style: TextStyle(
  370. fontWeight: FontWeight.bold,
  371. fontSize: 16,
  372. color: Colors.red),
  373. ),
  374. SizedBox(height: 6),
  375. Text(
  376. '1.2',
  377. style: TextStyle(
  378. fontSize: 15.0, fontWeight: FontWeight.bold),
  379. ),
  380. SizedBox(height: 15),
  381. Text(
  382. 'Ukuran Ban',
  383. style: TextStyle(
  384. fontWeight: FontWeight.bold,
  385. fontSize: 16,
  386. color: Colors.red),
  387. ),
  388. SizedBox(height: 6),
  389. Text(
  390. '750-16-12',
  391. style: TextStyle(
  392. fontSize: 15.0, fontWeight: FontWeight.bold),
  393. ),
  394. SizedBox(height: 15),
  395. Text(
  396. 'Panjang Kendaraan',
  397. style: TextStyle(
  398. fontWeight: FontWeight.bold,
  399. fontSize: 16,
  400. color: Colors.red),
  401. ),
  402. SizedBox(height: 6),
  403. Text(
  404. '5676',
  405. style: TextStyle(
  406. fontSize: 15.0, fontWeight: FontWeight.bold),
  407. ),
  408. SizedBox(height: 15),
  409. Text(
  410. 'Lebar Kendaraan',
  411. style: TextStyle(
  412. fontWeight: FontWeight.bold,
  413. fontSize: 16,
  414. color: Colors.red),
  415. ),
  416. SizedBox(height: 6),
  417. Text(
  418. '2045',
  419. style: TextStyle(
  420. fontSize: 15.0, fontWeight: FontWeight.bold),
  421. ),
  422. SizedBox(height: 15),
  423. Text(
  424. 'Tinggi Kendaraan',
  425. style: TextStyle(
  426. fontWeight: FontWeight.bold,
  427. fontSize: 16,
  428. color: Colors.red),
  429. ),
  430. SizedBox(height: 6),
  431. Text(
  432. '2165',
  433. style: TextStyle(
  434. fontSize: 15.0, fontWeight: FontWeight.bold),
  435. ),
  436. SizedBox(height: 15),
  437. Text(
  438. 'Panjang Bak atau Tangki',
  439. style: TextStyle(
  440. fontWeight: FontWeight.bold,
  441. fontSize: 16,
  442. color: Colors.red),
  443. ),
  444. SizedBox(height: 6),
  445. Text(
  446. '3500',
  447. style: TextStyle(
  448. fontSize: 15.0, fontWeight: FontWeight.bold),
  449. ),
  450. SizedBox(height: 15),
  451. Text(
  452. 'Lebar Bak atau Tangki',
  453. style: TextStyle(
  454. fontWeight: FontWeight.bold,
  455. fontSize: 16,
  456. color: Colors.red),
  457. ),
  458. SizedBox(height: 6),
  459. Text(
  460. '2045',
  461. style: TextStyle(
  462. fontSize: 15.0, fontWeight: FontWeight.bold),
  463. ),
  464. SizedBox(height: 15),
  465. Text(
  466. 'Tinggi Bak atau Tangki',
  467. style: TextStyle(
  468. fontWeight: FontWeight.bold,
  469. fontSize: 16,
  470. color: Colors.red),
  471. ),
  472. SizedBox(height: 6),
  473. Text(
  474. '700',
  475. style: TextStyle(
  476. fontSize: 15.0, fontWeight: FontWeight.bold),
  477. ),
  478. SizedBox(height: 15),
  479. Text(
  480. 'Julur Depan',
  481. style: TextStyle(
  482. fontWeight: FontWeight.bold,
  483. fontSize: 16,
  484. color: Colors.red),
  485. ),
  486. SizedBox(height: 6),
  487. Text(
  488. '1066',
  489. style: TextStyle(
  490. fontSize: 15.0, fontWeight: FontWeight.bold),
  491. ),
  492. SizedBox(height: 15),
  493. Text(
  494. 'Julur Belakang',
  495. style: TextStyle(
  496. fontWeight: FontWeight.bold,
  497. fontSize: 16,
  498. color: Colors.red),
  499. ),
  500. SizedBox(height: 6),
  501. Text(
  502. '1230',
  503. style: TextStyle(
  504. fontSize: 15.0, fontWeight: FontWeight.bold),
  505. ),
  506. SizedBox(height: 15),
  507. Text(
  508. 'Jarak Sumbu 1_2',
  509. style: TextStyle(
  510. fontWeight: FontWeight.bold,
  511. fontSize: 16,
  512. color: Colors.red),
  513. ),
  514. SizedBox(height: 6),
  515. Text(
  516. '3380',
  517. style: TextStyle(
  518. fontSize: 15.0, fontWeight: FontWeight.bold),
  519. ),
  520. SizedBox(height: 15),
  521. Text(
  522. 'Jarak Sumbu 2_3',
  523. style: TextStyle(
  524. fontWeight: FontWeight.bold,
  525. fontSize: 16,
  526. color: Colors.red),
  527. ),
  528. SizedBox(height: 6),
  529. Text(
  530. '0',
  531. style: TextStyle(
  532. fontSize: 15.0, fontWeight: FontWeight.bold),
  533. ),
  534. SizedBox(height: 15),
  535. Text(
  536. 'Jarak Sumbu 3_4',
  537. style: TextStyle(
  538. fontWeight: FontWeight.bold,
  539. fontSize: 16,
  540. color: Colors.red),
  541. ),
  542. SizedBox(height: 6),
  543. Text(
  544. '0',
  545. style: TextStyle(
  546. fontSize: 15.0, fontWeight: FontWeight.bold),
  547. ),
  548. SizedBox(height: 15),
  549. Text(
  550. 'Daya Angkut Orang',
  551. style: TextStyle(
  552. fontWeight: FontWeight.bold,
  553. fontSize: 16,
  554. color: Colors.red),
  555. ),
  556. SizedBox(height: 6),
  557. Text(
  558. '3',
  559. style: TextStyle(
  560. fontSize: 15.0, fontWeight: FontWeight.bold),
  561. ),
  562. SizedBox(height: 15),
  563. Text(
  564. 'Daya Angkut Barang',
  565. style: TextStyle(
  566. fontWeight: FontWeight.bold,
  567. fontSize: 16,
  568. color: Colors.red),
  569. ),
  570. SizedBox(height: 6),
  571. Text(
  572. '3940',
  573. style: TextStyle(
  574. fontSize: 15.0, fontWeight: FontWeight.bold),
  575. ),
  576. SizedBox(height: 15),
  577. Text(
  578. 'Kelas Jalan Terendah',
  579. style: TextStyle(
  580. fontWeight: FontWeight.bold,
  581. fontSize: 16,
  582. color: Colors.red),
  583. ),
  584. SizedBox(height: 6),
  585. Text(
  586. 'III',
  587. style: TextStyle(
  588. fontSize: 15.0, fontWeight: FontWeight.bold),
  589. ),
  590. ],
  591. )
  592. // Image.asset(
  593. // "assets/img/logopolantas.png",
  594. // width: 200,
  595. // height: 200,
  596. // ),
  597. ],
  598. ),
  599. );
  600. }),
  601. );
  602. }
  603. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement