TIF_E41202429/Mobile/patrolin/skripsi/lib/widget/card_kasus_training.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_training.dart';
class CardKasusTraining extends StatelessWidget {
final KasusTraining kasusTraining;
final VoidCallback onTap;
const CardKasusTraining({
super.key,
required this.kasusTraining,
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(
kasusTraining.idKasusTraining ?? "Kosong",
style: robotoSedangHitam,
),
),
),
SizedBox(width: 10.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(kasusTraining.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(
kasusTraining.jarakTkpPolres ?? "Kosong",
style: robotoKecilHitam.copyWith(
fontWeight: FontWeight.bold),
),
SizedBox(height: 4.h),
Text(
kasusTraining.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: kasusTraining.status == 'Rendah'
? rendahColor
: (kasusTraining.status == 'Sedang'
? sedangColor
: tinggiColor)),
child: Center(
child: Text(
kasusTraining.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),
// ),
// ),
// )
// ],
// ),
// ]),
// );
// }
// }