43 lines
1016 B
Dart
43 lines
1016 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:together_mobile/models/contact_model.dart';
|
|
import 'package:together_mobile/models/init_get_it.dart';
|
|
|
|
import 'friend_tile.dart';
|
|
|
|
class FriendGroup extends StatelessWidget {
|
|
const FriendGroup({
|
|
super.key,
|
|
required this.groupName,
|
|
});
|
|
|
|
final String groupName;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ExpansionTile(
|
|
title: Text(groupName),
|
|
trailing: Text(
|
|
getIt
|
|
.get<Contact>()
|
|
.filterGroupFriends(groupName)
|
|
.length
|
|
.toString(),
|
|
),
|
|
children: List.generate(
|
|
getIt.get<Contact>().filterGroupFriends(groupName).length,
|
|
(index) => FriendTile(
|
|
key: ValueKey(
|
|
getIt.get<Contact>().friends.keys.toList()[index],
|
|
),
|
|
friendId: getIt
|
|
.get<Contact>()
|
|
.filterGroupFriends(groupName)
|
|
.keys
|
|
.toList()[index],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|