refactor: implement lazy initialization for global BlocProviders and enhance Firebase initialization with timeout handling

This commit is contained in:
mso7nueh
2026-01-13 12:22:22 +03:00
parent a778257215
commit d206e7ec12
13 changed files with 161 additions and 41 deletions

View File

@@ -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