| 
																	
																	
																		
																			
																		
																	
																	
																 | 
																@ -29,6 +29,7 @@ class ConversationList extends StatefulWidget { | 
															
														
														
													
														
															
																 | 
																 | 
																
 | 
																 | 
																 | 
																
 | 
															
														
														
													
														
															
																 | 
																 | 
																class _ConversationListState extends State<ConversationList> { | 
																 | 
																 | 
																class _ConversationListState extends State<ConversationList> { | 
															
														
														
													
														
															
																 | 
																 | 
																  final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>(); | 
																 | 
																 | 
																  final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>(); | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																  late ScrollController _scrollController; | 
															
														
														
													
														
															
																 | 
																 | 
																
 | 
																 | 
																 | 
																
 | 
															
														
														
													
														
															
																 | 
																 | 
																  List<Conversation> conversations = []; | 
																 | 
																 | 
																  List<Conversation> conversations = []; | 
															
														
														
													
														
															
																 | 
																 | 
																  List<Friend> friends = []; | 
																 | 
																 | 
																  List<Friend> friends = []; | 
															
														
														
													
												
													
														
															
																| 
																	
																		
																			
																		
																	
																	
																		
																			
																		
																	
																	
																 | 
																@ -148,6 +149,8 @@ class _ConversationListState extends State<ConversationList> { | 
															
														
														
													
														
															
																 | 
																 | 
																
 | 
																 | 
																 | 
																
 | 
															
														
														
													
														
															
																 | 
																 | 
																  @override | 
																 | 
																 | 
																  @override | 
															
														
														
													
														
															
																 | 
																 | 
																  void initState() { | 
																 | 
																 | 
																  void initState() { | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																    _scrollController = ScrollController(); | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																    _scrollController.addListener(_scrollListener); | 
															
														
														
													
														
															
																 | 
																 | 
																    super.initState(); | 
																 | 
																 | 
																    super.initState(); | 
															
														
														
													
														
															
																 | 
																 | 
																    conversations.addAll(widget.conversations); | 
																 | 
																 | 
																    conversations.addAll(widget.conversations); | 
															
														
														
													
														
															
																 | 
																 | 
																    friends.addAll(widget.friends); | 
																 | 
																 | 
																    friends.addAll(widget.friends); | 
															
														
														
													
												
													
														
															
																| 
																	
																	
																	
																		
																			
																		
																	
																 | 
																@ -162,6 +165,7 @@ class _ConversationListState extends State<ConversationList> { | 
															
														
														
													
														
															
																 | 
																 | 
																    } | 
																 | 
																 | 
																    } | 
															
														
														
													
														
															
																 | 
																 | 
																
 | 
																 | 
																 | 
																
 | 
															
														
														
													
														
															
																 | 
																 | 
																    return ListView.builder( | 
																 | 
																 | 
																    return ListView.builder( | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																      controller: _scrollController, | 
															
														
														
													
														
															
																 | 
																 | 
																      itemCount: conversations.length, | 
																 | 
																 | 
																      itemCount: conversations.length, | 
															
														
														
													
														
															
																 | 
																 | 
																      shrinkWrap: false, | 
																 | 
																 | 
																      shrinkWrap: false, | 
															
														
														
													
														
															
																 | 
																 | 
																      physics: const AlwaysScrollableScrollPhysics(), | 
																 | 
																 | 
																      physics: const AlwaysScrollableScrollPhysics(), | 
															
														
														
													
												
													
														
															
																| 
																	
																	
																	
																		
																			
																		
																	
																 | 
																@ -184,6 +188,21 @@ class _ConversationListState extends State<ConversationList> { | 
															
														
														
													
														
															
																 | 
																 | 
																    setState(() {}); | 
																 | 
																 | 
																    setState(() {}); | 
															
														
														
													
														
															
																 | 
																 | 
																  } | 
																 | 
																 | 
																  } | 
															
														
														
													
														
															
																 | 
																 | 
																
 | 
																 | 
																 | 
																
 | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																  Future<void> _scrollListener() async { | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																    if (!(_scrollController.offset >= _scrollController.position.maxScrollExtent)) { | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																      return; | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																    } | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																
 | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																    int page = 0; | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																
 | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																    if (conversations.length > 19) { | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																      page = conversations.length ~/ 20; | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																    } | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																
 | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																    await ConversationsService.updateConversations(page: page); | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																    onGoBack(null); | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																  } | 
															
														
														
													
														
															
																 | 
																 | 
																 | 
																 | 
																 | 
																
 | 
															
														
														
													
														
															
																 | 
																 | 
																  onGoBack(dynamic value) async { | 
																 | 
																 | 
																  onGoBack(dynamic value) async { | 
															
														
														
													
														
															
																 | 
																 | 
																    conversations = await ConversationsRepository.getConversations(); | 
																 | 
																 | 
																    conversations = await ConversationsRepository.getConversations(); | 
															
														
														
													
														
															
																 | 
																 | 
																    friends = await FriendsRepository.getFriends(); | 
																 | 
																 | 
																    friends = await FriendsRepository.getFriends(); | 
															
														
														
													
												
													
														
															
																| 
																	
																		
																			
																		
																	
																	
																	
																 | 
																
  |