1import 'package:connect/core/localization/app_localizations.dart';
3import '/core/ui/screens/views/faild_to_fetch_data_view.dart';
4import '/core/ui/widgets/custom_scaffold.dart';
5import '/features/notifications/presentation/logic/notifications_cubit/notifications_cubit.dart';
6import '/features/notifications/presentation/notifications_screen/views/notifications_loaded_view.dart';
7import 'package:flutter/material.dart';
8import 'package:flutter_bloc/flutter_bloc.dart';
10import '../../../authentication/presentation/logic/authentication_bloc/authentication_bloc.dart';
16 State<NotificationsScreen>
createState() => _NotificationsScreenState();
19class _NotificationsScreenState
extends State<NotificationsScreen> {
21 final authenticationState = context.read<AuthenticationBloc>().state;
22 if (authenticationState is AuthenticatedState) {
23 int?
uid = authenticationState.session.uid;
25 context.read<NotificationsCubit>().loadNotifications(
'$uid');
37 Widget
build(BuildContext context) {
38 return BlocBuilder<NotificationsCubit, NotificationsState>(
39 builder: (context, state) {
40 return CustomScaffold(
42 isLeadingVisible:
true,
43 isLoading: state is LoadingNotificationsState,
53 if (state is NotificationsLoadedState) {
56 return FailedToFetchDataView(
60 return const SizedBox();
String translate(String key)
static AppLocalizations of(BuildContext context)
final List< NotificationEntity > notifications
override void initState()
_adaptViewToState(DashboardState state)
class ElearningScreen extends StatefulWidget _triggerEnvironmentalDashboardLoaderEvent()
override Widget build(BuildContext context)
const NotificationsScreen({super.key})
const NotificationsLoadingFailureState({required this.failure})