mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Automatically refresh the list of notifications when required
This commit is contained in:
		@@ -1,3 +1,4 @@
 | 
			
		||||
import 'package:comunic/helpers/events_helper.dart';
 | 
			
		||||
import 'package:comunic/helpers/groups_helper.dart';
 | 
			
		||||
import 'package:comunic/helpers/notifications_helper.dart';
 | 
			
		||||
import 'package:comunic/helpers/users_helper.dart';
 | 
			
		||||
@@ -7,6 +8,7 @@ import 'package:comunic/lists/users_list.dart';
 | 
			
		||||
import 'package:comunic/models/notification.dart' as n;
 | 
			
		||||
import 'package:comunic/ui/routes/main_route.dart';
 | 
			
		||||
import 'package:comunic/ui/widgets/account_image_widget.dart';
 | 
			
		||||
import 'package:comunic/ui/widgets/safe_state.dart';
 | 
			
		||||
import 'package:comunic/utils/date_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/navigation_utils.dart';
 | 
			
		||||
@@ -26,7 +28,7 @@ class NotificationsScreen extends StatefulWidget {
 | 
			
		||||
  _NotificationsScreenState createState() => _NotificationsScreenState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _NotificationsScreenState extends State<NotificationsScreen> {
 | 
			
		||||
class _NotificationsScreenState extends SafeState<NotificationsScreen> {
 | 
			
		||||
  NotificationsList _list;
 | 
			
		||||
  UsersList _users;
 | 
			
		||||
  GroupsList _groups;
 | 
			
		||||
@@ -62,6 +64,14 @@ class _NotificationsScreenState extends State<NotificationsScreen> {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void initState() {
 | 
			
		||||
    super.initState();
 | 
			
		||||
 | 
			
		||||
    this.listenChangeState<NewNumberNotifsEvent>(
 | 
			
		||||
            (d) => _refreshKey.currentState.show());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void didChangeDependencies() {
 | 
			
		||||
    super.didChangeDependencies();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user