Refactoring + Version améliorée
This commit is contained in:
42
lib/presentation/widgets/event_status_badge.dart
Normal file
42
lib/presentation/widgets/event_status_badge.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class EventStatusBadge extends StatelessWidget {
|
||||
final String status;
|
||||
|
||||
const EventStatusBadge({Key? key, required this.status}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
|
||||
decoration: BoxDecoration(
|
||||
color: status == 'fermé' ? Colors.red.withOpacity(0.2) : Colors.green.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
border: Border.all(
|
||||
color: status == 'fermé' ? Colors.red : Colors.green,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
status == 'fermé' ? Icons.lock : Icons.lock_open,
|
||||
color: status == 'fermé' ? Colors.red : Colors.green,
|
||||
size: 16.0,
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
status == 'fermé' ? 'Fermé' : 'Ouvert',
|
||||
style: TextStyle(
|
||||
color: status == 'fermé' ? Colors.red : Colors.green,
|
||||
fontSize: 12,
|
||||
fontStyle: FontStyle.italic,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user