progress on batches
This commit is contained in:
44
lib/widgets/status_chip_widget.dart
Normal file
44
lib/widgets/status_chip_widget.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StatusChip extends StatelessWidget {
|
||||
final String status;
|
||||
|
||||
const StatusChip({super.key, required this.status});
|
||||
|
||||
Color _color() {
|
||||
switch (status.toUpperCase()) {
|
||||
case 'SUCCESS':
|
||||
case 'COMPLETE':
|
||||
return Colors.green;
|
||||
case 'FAILED':
|
||||
return Colors.red;
|
||||
case 'PROCESSING':
|
||||
return Colors.orange;
|
||||
case 'CONFIRMED':
|
||||
return Colors.blue;
|
||||
default:
|
||||
return Colors.grey;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = _color();
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withAlpha(25),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: color.withAlpha(80)),
|
||||
),
|
||||
child: Text(
|
||||
status,
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user