1import 'package:flutter/material.dart';
2import 'package:flutter_bloc/flutter_bloc.dart';
4import '../../../../core/ui/screens/views/faild_to_fetch_data_view.dart';
5import '../../../../core/ui/widgets/custom_scaffold.dart';
6import '../../../authentication/presentation/logic/authentication_bloc/authentication_bloc.dart';
7import '../logic/cubit/environmental_dashboar_cubit.dart';
8import 'views/enviromental_dashboard_data_loaded_view.dart';
15 _EnvironmentalDashboardScreenState();
18class _EnvironmentalDashboardScreenState
19 extends State<EnvironmentalDashboardScreen> {
21 final authenticationState = context.read<AuthenticationBloc>().state;
22 if (authenticationState is AuthenticatedState) {
23 String?
partnerId = authenticationState.session.partnerId;
26 .read<EnvironmentalDashboarCubit>()
39 Widget
build(BuildContext context) {
40 return BlocBuilder<EnvironmentalDashboarCubit, EnvironmentalDashboarState>(
41 builder: (context, state) {
48 if (state is EnvironmentalDashboardLoadedSuccessfullyState) {
49 return EnvironmentalDashboardView(entity: state.
entity);
51 return FailedToFetchDataView(
55 return const SizedBox();
final EnvironmentalDashboardEntity entity
override void initState()
_adaptViewToState(DashboardState state)
class ElearningScreen extends StatefulWidget _triggerEnvironmentalDashboardLoaderEvent()
const EnvironmentalDashboardLoadingFailureState({required this.failure})
const EnvironmentalDashboardScreen({super.key})
override Widget build(BuildContext context)