import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:skripsi/config/theme.dart'; class CardRuteP extends StatelessWidget { const CardRuteP({ super.key, required this.alamat, required this.jam, required this.status, required this.id, }); final String alamat; final String jam; final String status; final int id; @override Widget build(BuildContext context) { return 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( id.toString(), style: robotoSedangHitam, ), ), ), SizedBox(width: 10.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(alamat, style: robotoSedangHitam.copyWith( fontWeight: FontWeight.bold)), Text( 'Tingkat Kriminal', style: robotoSedangHitam, ), ], ) ], ), ), Column( children: [ Text( jam, style: robotoKecilHitam.copyWith(fontWeight: FontWeight.bold), ), Container( height: 16.h, width: 46.w, decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.w), color: status == 'Rendah' ? rendahColor : (status == 'Sedang' ? sedangColor : tinggiColor)), child: Center( child: Text( status, style: robotoKecilHitam, ), ), ) ], ) ], ), ); } } 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), ), ), ) ], ), ]), ); } }