Files
afterwork/lib/presentation/widgets/section_header.dart
2024-09-24 00:32:20 +00:00

33 lines
846 B
Dart

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