minor changes
This commit is contained in:
@@ -24,19 +24,16 @@ class _MarkListScreenState extends State<MarkListScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
final marks = Provider.of<MarkListProvider>(context);
|
||||
|
||||
// Responsive scale factor
|
||||
final screenWidth = MediaQuery.of(context).size.width;
|
||||
final scale = (screenWidth / 390).clamp(0.82, 1.35);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
iconTheme: const IconThemeData(color: Colors.black),
|
||||
|
||||
title: Text(
|
||||
"All Mark Numbers",
|
||||
style: TextStyle(
|
||||
@@ -50,14 +47,31 @@ class _MarkListScreenState extends State<MarkListScreen> {
|
||||
body: marks.loading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: ListView.builder(
|
||||
padding: EdgeInsets.all(10 * scale), // smaller padding
|
||||
padding: EdgeInsets.all(10 * scale),
|
||||
itemCount: marks.marks.length,
|
||||
itemBuilder: (_, i) {
|
||||
final m = marks.marks[i];
|
||||
final status =
|
||||
(m['status'] ?? '').toString().toLowerCase();
|
||||
|
||||
final LinearGradient statusGradient =
|
||||
status == 'active'
|
||||
? const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF2ECC71), // Green
|
||||
Color(0xFF1E8449), // Deep Emerald
|
||||
],
|
||||
)
|
||||
: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFFE74C3C), // Red
|
||||
Color(0xFFC0392B), // Dark Red
|
||||
],
|
||||
);
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.only(bottom: 10 * scale), // reduced margin
|
||||
padding: EdgeInsets.all(12 * scale), // smaller padding
|
||||
margin: EdgeInsets.only(bottom: 10 * scale),
|
||||
padding: EdgeInsets.all(12 * scale),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
@@ -67,16 +81,15 @@ class _MarkListScreenState extends State<MarkListScreen> {
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(14 * scale), // smaller radius
|
||||
borderRadius: BorderRadius.circular(14 * scale),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.06),
|
||||
blurRadius: 5 * scale, // smaller shadow
|
||||
blurRadius: 5 * scale,
|
||||
offset: Offset(0, 2 * scale),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -85,24 +98,20 @@ class _MarkListScreenState extends State<MarkListScreen> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// MARK NUMBER
|
||||
Text(
|
||||
m['mark_no'],
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16 * scale, // reduced font
|
||||
fontSize: 16 * scale,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 3 * scale),
|
||||
|
||||
// ROUTE
|
||||
Text(
|
||||
"${m['origin']} → ${m['destination']}",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13 * scale, // reduced font
|
||||
fontSize: 13 * scale,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
@@ -110,21 +119,21 @@ class _MarkListScreenState extends State<MarkListScreen> {
|
||||
),
|
||||
),
|
||||
|
||||
// STATUS BADGE
|
||||
// STATUS BADGE (GREEN / RED)
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 10 * scale,
|
||||
vertical: 5 * scale, // smaller badge
|
||||
vertical: 5 * scale,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.92),
|
||||
borderRadius: BorderRadius.circular(24 * scale),
|
||||
gradient: statusGradient,
|
||||
borderRadius: BorderRadius.circular(20 * scale),
|
||||
),
|
||||
child: Text(
|
||||
m['status'],
|
||||
style: TextStyle(
|
||||
fontSize: 11.5 * scale,
|
||||
color: Colors.black87,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user