Refactoring + Checkpoint
This commit is contained in:
107
lib/presentation/widgets/cards/support_section_card.dart
Normal file
107
lib/presentation/widgets/cards/support_section_card.dart
Normal file
@@ -0,0 +1,107 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import '../../../../core/constants/colors.dart';
|
||||
|
||||
/// [SupportSectionCard] affiche les options de support et assistance.
|
||||
/// Inclut des animations, du retour haptique, et des logs détaillés pour chaque action.
|
||||
class SupportSectionCard extends StatelessWidget {
|
||||
const SupportSectionCard({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
debugPrint("[LOG] Initialisation de SupportSectionCard.");
|
||||
|
||||
return Card(
|
||||
color: AppColors.cardColor.withOpacity(0.95),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
elevation: 6,
|
||||
shadowColor: AppColors.darkPrimary.withOpacity(0.4),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 20.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Support et Assistance',
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
letterSpacing: 1.1,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
_buildOption(
|
||||
context,
|
||||
icon: Icons.help_outline,
|
||||
label: 'Support et Assistance',
|
||||
logMessage: "Accès au Support et Assistance.",
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildOption(
|
||||
context,
|
||||
icon: Icons.article_outlined,
|
||||
label: 'Conditions d\'utilisation',
|
||||
logMessage: "Accès aux conditions d'utilisation.",
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildOption(
|
||||
context,
|
||||
icon: Icons.privacy_tip_outlined,
|
||||
label: 'Politique de confidentialité',
|
||||
logMessage: "Accès à la politique de confidentialité.",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Construit chaque option de support avec une animation de feedback visuel.
|
||||
Widget _buildOption(
|
||||
BuildContext context, {
|
||||
required IconData icon,
|
||||
required String label,
|
||||
required String logMessage,
|
||||
}) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
HapticFeedback.lightImpact(); // Retour haptique léger
|
||||
debugPrint("[LOG] $logMessage");
|
||||
// Ajout de la navigation ou de l'action ici.
|
||||
},
|
||||
splashColor: AppColors.accentColor.withOpacity(0.3),
|
||||
highlightColor: AppColors.cardColor.withOpacity(0.1),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, color: AppColors.accentColor, size: 28),
|
||||
const SizedBox(width: 15),
|
||||
Expanded(
|
||||
child: Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Icon(Icons.chevron_right, color: Colors.white70),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Construit un séparateur entre les options pour une meilleure structure visuelle.
|
||||
Widget _buildDivider() {
|
||||
return Divider(
|
||||
color: Colors.white.withOpacity(0.2),
|
||||
height: 1,
|
||||
indent: 16,
|
||||
endIndent: 16,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user