164 lines
5.7 KiB
Dart
164 lines
5.7 KiB
Dart
// ignore_for_file: avoid_unnecessary_containers
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:skripsi/config/theme.dart';
|
|
import 'package:skripsi/model/kasus_testing.dart';
|
|
|
|
class CardKasusTesting extends StatelessWidget {
|
|
final KasusTesting kasusTesting;
|
|
final VoidCallback ontap;
|
|
const CardKasusTesting({
|
|
super.key,
|
|
required this.kasusTesting,
|
|
required this.ontap,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: ontap,
|
|
child: Container(
|
|
child: Column(
|
|
children: [
|
|
Padding(
|
|
padding: EdgeInsets.only(top: 12.w),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
height: 40.w,
|
|
width: 40.w,
|
|
decoration: BoxDecoration(
|
|
shape:
|
|
BoxShape.circle, // Mengatur bentuk ke lingkaran
|
|
border: Border.all(
|
|
color: rendahColor, // Warna garis tepi
|
|
width: 2.w, // Ketebalan garis tepi
|
|
),
|
|
),
|
|
child: Center(
|
|
child: Text(
|
|
kasusTesting.idKasusTesting ?? "Kosong",
|
|
style: robotoSedangHitam,
|
|
),
|
|
),
|
|
),
|
|
SizedBox(width: 10.w),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(kasusTesting.tkp ?? "Kosong",
|
|
style: robotoSedangHitam.copyWith(
|
|
fontWeight: FontWeight.bold)),
|
|
SizedBox(height: 4.h),
|
|
Text(
|
|
'Jarak TKP - Polres',
|
|
style: robotoKecilHitam,
|
|
),
|
|
SizedBox(height: 4.h),
|
|
Text(
|
|
'Jumlah Kejahatan',
|
|
style: robotoKecilHitam,
|
|
),
|
|
SizedBox(height: 4.h),
|
|
Text(
|
|
'Tingkat Kriminal',
|
|
style: robotoKecilHitam,
|
|
),
|
|
],
|
|
)
|
|
],
|
|
),
|
|
),
|
|
Column(
|
|
children: [
|
|
Text(
|
|
" ",
|
|
style: robotoKecilHitam.copyWith(
|
|
fontWeight: FontWeight.bold),
|
|
),
|
|
SizedBox(height: 4.h),
|
|
Text(
|
|
kasusTesting.jarakTkpPolres ?? "Kosong",
|
|
style: robotoKecilHitam.copyWith(
|
|
fontWeight: FontWeight.bold),
|
|
),
|
|
SizedBox(height: 4.h),
|
|
Text(
|
|
kasusTesting.jumlahKejahatan ?? "Kosong",
|
|
style: robotoKecilHitam.copyWith(
|
|
fontWeight: FontWeight.bold),
|
|
),
|
|
SizedBox(height: 4.h),
|
|
Container(
|
|
height: 16.h,
|
|
width: 46.w,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(10.w),
|
|
color: kasusTesting.status == 'Rendah'
|
|
? rendahColor
|
|
: (kasusTesting.status == 'Sedang'
|
|
? sedangColor
|
|
: tinggiColor)),
|
|
child: Center(
|
|
child: Text(
|
|
kasusTesting.status ?? "Kosong",
|
|
style: robotoKecilHitam,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
SizedBox(height: 4.h),
|
|
const Divider()
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
// class CardRute extends StatelessWidget {
|
|
// const CardRute({
|
|
// super.key,
|
|
// });
|
|
|
|
// @override
|
|
// Widget build(BuildContext context) {
|
|
// return Padding(
|
|
// padding: EdgeInsets.only(left: 14.w, right: 14.w),
|
|
// child: Column(children: [
|
|
// const Row(
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
// children: [Text('Jl. Slamet Riyadi'), Text('04.00')],
|
|
// ),
|
|
// Row(
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
// children: [
|
|
// const Text('Tingkat Kriminalitas'),
|
|
// Container(
|
|
// height: 16.h,
|
|
// width: 46.w,
|
|
// decoration: BoxDecoration(
|
|
// borderRadius: BorderRadius.circular(10.w),
|
|
// color: sedangColor),
|
|
// child: Center(
|
|
// child: Text(
|
|
// 'Sedang',
|
|
// style: robotoKecilHitam.copyWith(fontSize: 8.sp),
|
|
// ),
|
|
// ),
|
|
// )
|
|
// ],
|
|
// ),
|
|
// ]),
|
|
// );
|
|
// }
|
|
// }
|