forked from eatvio/eatvio_app
refactor: implement lazy initialization for global BlocProviders and enhance Firebase initialization with timeout handling
This commit is contained in:
@@ -24,6 +24,14 @@ class _NotificationsScreenState extends State<NotificationsScreen> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_scrollController.addListener(_onScroll);
|
||||
// Инициализация NotificationsCubit при первом открытии экрана
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final cubit = context.read<NotificationsCubit>();
|
||||
final state = cubit.state;
|
||||
if (state is! NotificationsStateLoaded && state is! NotificationsStateError) {
|
||||
cubit.getNotifications();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user