153 lines
5.7 KiB
Dart
153 lines
5.7 KiB
Dart
// ignore_for_file: curly_braces_in_flow_control_structures
|
|
|
|
import 'package:d_view/d_view.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:skripsi/config/theme.dart';
|
|
import 'package:skripsi/controller/cKasusTesting.dart';
|
|
import 'package:skripsi/model/kasus_testing.dart';
|
|
import 'package:skripsi/widget/card_kasus_riwayat.dart';
|
|
|
|
class PatroliPage extends StatefulWidget {
|
|
const PatroliPage({super.key});
|
|
|
|
@override
|
|
State<PatroliPage> createState() => _PatroliPageState();
|
|
}
|
|
|
|
class _PatroliPageState extends State<PatroliPage> {
|
|
final cKasusTestingTinggi = Get.put(CKasusTesting());
|
|
|
|
refresh() {
|
|
cKasusTestingTinggi.getListKasusTestingTinggi();
|
|
}
|
|
|
|
@override
|
|
void initState() {
|
|
refresh();
|
|
cKasusTestingTinggi.listKasusTestingTinggi;
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Padding(
|
|
padding: EdgeInsets.fromLTRB(10.w, 10.w, 10.w, 60.w),
|
|
child: Column(
|
|
children: [
|
|
Image.asset('assets/logo.png', height: 120.w, width: 120.w),
|
|
SizedBox(height: 8.h),
|
|
Text(
|
|
'Patrol.In',
|
|
style: robotoBesarHitam.copyWith(
|
|
decoration: TextDecoration.underline,
|
|
decorationColor: blackColor,
|
|
decorationThickness: 1),
|
|
),
|
|
// SingleChildScrollView(
|
|
// scrollDirection: Axis.horizontal,
|
|
// child: Row(
|
|
// children: [
|
|
// const StatisticCard(judul: 'Total Daerah', isi: '16'),
|
|
// SizedBox(width: 12.w),
|
|
// const StatisticCard(
|
|
// judul: 'Tingkat Kriminal Rendah', isi: '5'),
|
|
// SizedBox(width: 12.w),
|
|
// const StatisticCard(
|
|
// judul: 'Tingkat Kriminal Sedang', isi: '7'),
|
|
// SizedBox(width: 12.w),
|
|
// const StatisticCard(
|
|
// judul: 'Tingkat Kriminal Tinggi', isi: '4'),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
SizedBox(height: 16.h),
|
|
Text('Riwayat Testing',
|
|
style: robotoBesarHitam.copyWith(fontWeight: FontWeight.bold)),
|
|
const Divider(),
|
|
Expanded(
|
|
child: GetBuilder<CKasusTesting>(
|
|
builder: (_) {
|
|
if (_.loading) return DView.loadingCircle();
|
|
if (_.listKasusTestingTinggi.isEmpty)
|
|
return DView.empty('Kosong');
|
|
return RefreshIndicator(
|
|
onRefresh: () async => refresh(),
|
|
child: ListView.builder(
|
|
itemCount: _.listKasusTestingTinggi.length,
|
|
itemBuilder: (BuildContext context, int index) {
|
|
KasusTesting kasusTesting =
|
|
_.listKasusTestingTinggi[index];
|
|
return CardRiwayat(kasusTesting: kasusTesting);
|
|
},
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
// Image.asset('assets/logo.png', height: 120.w, width: 120.w),
|
|
// SizedBox(height: 8.h),
|
|
// Text(
|
|
// 'Patrol.In',
|
|
// style: robotoBesarHitam.copyWith(
|
|
// decoration: TextDecoration.underline,
|
|
// decorationColor: blackColor,
|
|
// decorationThickness: 1),
|
|
// ),
|
|
// SizedBox(height: 16.h),
|
|
// SingleChildScrollView(
|
|
// scrollDirection: Axis.horizontal,
|
|
// child: Row(
|
|
// children: [
|
|
// const StatisticCard(judul: 'Total Daerah', isi: '16'),
|
|
// SizedBox(width: 12.w),
|
|
// const StatisticCard(
|
|
// judul: 'Tingkat Kriminal Rendah', isi: '5'),
|
|
// SizedBox(width: 12.w),
|
|
// const StatisticCard(
|
|
// judul: 'Tingkat Kriminal Sedang', isi: '7'),
|
|
// SizedBox(width: 12.w),
|
|
// const StatisticCard(
|
|
// judul: 'Tingkat Kriminal Tinggi', isi: '4'),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
// Container(
|
|
// height: MediaQuery.of(context).size.width + 90.w,
|
|
// decoration: BoxDecoration(
|
|
// borderRadius: BorderRadius.circular(12.w),
|
|
// ),
|
|
// child: Padding(
|
|
// padding: EdgeInsets.only(top: 8.w, left: 8.w, right: 8.w),
|
|
// child: SingleChildScrollView(
|
|
// child: Column(
|
|
// children: [
|
|
// Text('Riwayat Test',
|
|
// style: robotoBesarHitam.copyWith(
|
|
// fontWeight: FontWeight.bold)),
|
|
// const Divider(),
|
|
// ListView.builder(
|
|
// scrollDirection: Axis.vertical,
|
|
// shrinkWrap: true,
|
|
// physics: const NeverScrollableScrollPhysics(),
|
|
// itemCount: _ruteP.length,
|
|
// itemBuilder: (context, index) => CardRuteP(
|
|
// alamat: _ruteP[index].alamat,
|
|
// jam: _ruteP[index].jam,
|
|
// status: _ruteP[index].status,
|
|
// id: _ruteP[index].id),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// ),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|