ptitspas-ynov/frontend/lib/widgets/dashbord_parent/ChildrenSidebarwidget.dart
Hanim 9f874f30e7 feat: Add dashboard layout with sidebar and main content area
- Implemented AppFooter widget for mobile and desktop views.
- Created ChildrenSidebar widget to display children's information.
- Developed AppLayout to manage app structure with optional footer.
- Added ChildrenSidebar for selecting children and displaying their status.
- Introduced DashboardAppBar for navigation and user actions.
- Built WMainContentArea for displaying assistant details and calendar.
- Created MainContentArea to manage contracts and events display.
- Implemented MessagingSidebar for messaging functionality.
- Updated widget tests to reflect new structure and imports.
2025-08-28 12:58:44 +02:00

58 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
class Childrensidebarwidget extends StatelessWidget{
final void Function(String childId) onChildSelected;
const Childrensidebarwidget({
Key? key,
required this.onChildSelected,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final children = [
{'id': '1', 'name': 'Léna', 'photo': null, 'status': 'Actif'},
{'id': '2', 'name': 'Noé', 'photo': null, 'status': 'Inactif'},
];
return Container(
color: const Color(0xFFF7F7F7),
padding: const EdgeInsets.all(16),
child: Column(
children: [
// Avatar parent + bouton
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const CircleAvatar(radius: 24, child: Icon(Icons.person)),
IconButton(
icon: const Icon(Icons.add),
onPressed: () {
// Naviguer vers ajout d'enfant
},
)
],
),
const SizedBox(height: 16),
const Text("Mes enfants", style: TextStyle(fontWeight: FontWeight.bold)),
const SizedBox(height: 16),
// Liste des enfants
...children.map((child) {
return GestureDetector(
onTap: () => onChildSelected(child['id']!),
child: Card(
color: child['status'] == 'Actif' ? Colors.teal.shade50 : Colors.white,
child: ListTile(
leading: const CircleAvatar(child: Icon(Icons.child_care)),
title: Text(child['name']!),
subtitle: Text(child['status']!),
),
),
);
}).toList()
],
),
);
}
}