Refactoring + Version améliorée

This commit is contained in:
DahoudG
2024-09-25 21:28:04 +00:00
parent 6b12cfeb41
commit 8e625c1080
28 changed files with 1113 additions and 261 deletions

View 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,
),
),
],
),
);
}
}