feat: Add user-specific group retrieval and enhance UI with dynamic theming
This commit is contained in:
@@ -22,11 +22,11 @@ class _GroupContentState extends State<GroupContent> {
|
||||
if (user == null || user.id == null) {
|
||||
return const Center(
|
||||
child: Text('Utilisateur non connecté'),
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
return StreamBuilder<List<Group>>(
|
||||
stream: GroupService().getGroupsStream(),
|
||||
stream: GroupService().getGroupsStreamByUser(user.id!), // Filtrer par utilisateur
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return _buildLoadingState();
|
||||
@@ -52,11 +52,11 @@ class _GroupContentState extends State<GroupContent> {
|
||||
}
|
||||
|
||||
final groups = snapshot.data ?? [];
|
||||
print("Groupes reçus: ${groups.length}");
|
||||
print("Groupes reçus pour l'utilisateur ${user.id}: ${groups.length}");
|
||||
|
||||
return RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
setState() {};
|
||||
setState(() {});
|
||||
},
|
||||
child: SingleChildScrollView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
@@ -74,13 +74,15 @@ class _GroupContentState extends State<GroupContent> {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
groups.isEmpty ? _buildEmptyState() : _buildGroupList(groups),
|
||||
const SizedBox(height: 80),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}),
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user