refactoring and checkpoint
This commit is contained in:
32
lib/presentation/widgets/section_header.dart
Normal file
32
lib/presentation/widgets/section_header.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SectionHeader extends StatelessWidget {
|
||||
final String title;
|
||||
final IconData icon;
|
||||
final TextStyle? textStyle; // Ajout de la possibilité de personnaliser le style du texte
|
||||
|
||||
const SectionHeader({
|
||||
required this.title,
|
||||
required this.icon,
|
||||
this.textStyle, // Paramètre optionnel
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: textStyle ?? const TextStyle( // Utilisation du style fourni ou d'un style par défaut
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Icon(icon, color: Colors.white),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user