Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- import 'package:http/http.dart' as http;
- import 'dart:async';
- import 'dart:convert';
- import '../modelHttp/datahasiluji/JsonAPIhasiluji.dart';
- class ListDataPage extends StatefulWidget {
- static String tag = 'listdatahasiluji-page';
- @override
- _ListDataPageState createState() => _ListDataPageState();
- }
- class _ListDataPageState extends State<ListDataPage> {
- Future<ListModel> getDataHasilUji() async {
- final response = await http
- .get("http://192.168.5.33:8080/dishub/wscekkendaraan/datauji?no=${no}");
- return ListModel.fromJson(json.decode(response.body));
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: new FutureBuilder<ListModel>(
- future: getDataHasilUji(),
- builder: (context, snapshot) {
- if (snapshot.hasError) print(snapshot.error);
- return snapshot.hasData
- ? new ItemList(
- list: snapshot.data,
- )
- : new Center(
- child: new CircularProgressIndicator(),
- );
- },
- ),
- appBar: AppBar(
- leading: IconButton(
- icon: Icon(Icons.arrow_back_ios),
- onPressed: () {
- Navigator.of(context).pop();
- }),
- iconTheme: IconThemeData(
- color: Colors.white, //change your color here
- ),
- title: Text("Data Hasil Uji Kendaraan"),
- ),
- );
- }
- }
- class ItemList extends StatelessWidget {
- final ListModel list;
- ItemList({this.list});
- @override
- Widget build(BuildContext context) {
- return Material(
- child: ListView.builder(
- itemCount: list == null ? 0 : list.result.data.length,
- itemBuilder: (BuildContext context, int index) {
- return Scaffold(
- body: Stack(
- children: <Widget>[
- Container(
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage("assets/img/logopolantas.png"),
- fit: BoxFit.fitWidth)),
- ),
- ListView(
- padding: EdgeInsets.only(left: 10.0, top: 10.0),
- children: <Widget>[
- Text(
- 'No. Uji',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- list.result.data[index].noUji,
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Nama Pemilik',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Alamat Pemilik',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- 'KARANGNANAS,Karangnanas Kec. Sokaraja Kab. Banyumas',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'No. Sertifikat Registrasi',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '045633/SM-SRUT/DRJD-SPD/XII/2018',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Tgl. Sertifikat Registrasi',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '11-12-2018',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'No. Registrasi Kendaraan',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- 'R 1542 YA',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'No. Rangka',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- 'MJEC1JG4315169507',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'No. Mesin',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- 'W04DTRR59428',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Merek',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- 'HINO',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Tipe',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- 'WU342R',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Jenis',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- 'MOBIL BARANG BAK TERBUKA',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Tahun Pembuatan',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '2018',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Bahan Bakar',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- 'SOLAR',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Isi Silinder',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '4009',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Daya Motor Penggerak',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '96',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'JBB',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '8250',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'JBKB',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '0',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'JBI',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '8166',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'JBKI',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '0',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'MST',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '5280',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Berat Kosong',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '4046',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Konfigurasi Sumbu Roda',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '1.2',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Ukuran Ban',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '750-16-12',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Panjang Kendaraan',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '5676',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Lebar Kendaraan',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '2045',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Tinggi Kendaraan',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '2165',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Panjang Bak atau Tangki',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '3500',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Lebar Bak atau Tangki',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '2045',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Tinggi Bak atau Tangki',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '700',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Julur Depan',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '1066',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Julur Belakang',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '1230',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Jarak Sumbu 1_2',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '3380',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Jarak Sumbu 2_3',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '0',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Jarak Sumbu 3_4',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '0',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Daya Angkut Orang',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '3',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Daya Angkut Barang',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- '3940',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 15),
- Text(
- 'Kelas Jalan Terendah',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: Colors.red),
- ),
- SizedBox(height: 6),
- Text(
- 'III',
- style: TextStyle(
- fontSize: 15.0, fontWeight: FontWeight.bold),
- ),
- ],
- )
- // Image.asset(
- // "assets/img/logopolantas.png",
- // width: 200,
- // height: 200,
- // ),
- ],
- ),
- );
- }),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement