|
|
@ -33,7 +33,7 @@ class _HomeState extends State<Home> { |
|
|
|
int _selectedIndex = 0; |
|
|
|
List<Widget> _widgetOptions = <Widget>[ |
|
|
|
const ConversationList(conversations: [], friends: []), |
|
|
|
const FriendList(), |
|
|
|
FriendList(friends: const [], friendRequests: const [], callback: () {}), |
|
|
|
Profile( |
|
|
|
profile: MyProfile( |
|
|
|
id: '', |
|
|
@ -154,6 +154,7 @@ class _HomeState extends State<Home> { |
|
|
|
|
|
|
|
conversations = await getConversations(); |
|
|
|
friends = await getFriends(accepted: true); |
|
|
|
friendRequests = await getFriends(accepted: false); |
|
|
|
profile = await MyProfile.getProfile(); |
|
|
|
|
|
|
|
setState(() { |
|
|
@ -162,13 +163,22 @@ class _HomeState extends State<Home> { |
|
|
|
conversations: conversations, |
|
|
|
friends: friends, |
|
|
|
), |
|
|
|
const FriendList(), |
|
|
|
FriendList( |
|
|
|
friends: friends, |
|
|
|
friendRequests: friendRequests, |
|
|
|
callback: initFriends, |
|
|
|
), |
|
|
|
Profile(profile: profile), |
|
|
|
]; |
|
|
|
isLoading = false; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
Future<void> initFriends() async { |
|
|
|
friends = await getFriends(accepted: true); |
|
|
|
friendRequests = await getFriends(accepted: false); |
|
|
|
} |
|
|
|
|
|
|
|
void _onItemTapped(int index) { |
|
|
|
setState(() { |
|
|
|
_selectedIndex = index; |
|
|
|