1import 'package:flutter/material.dart';
2import 'package:flutter_bloc/flutter_bloc.dart';
3import '../../features/authentication/presentation/logic/authentication_bloc/authentication_bloc.dart';
4import '../../features/authentication/domain/entities/session_entity.dart';
6extension RouterContextExtension on BuildContext {
8 final authState = read<AuthenticationBloc>().state;
9 return authState is AuthenticatedState ? authState.session : null;
16 final currentSession = session;
17 if (currentSession != null) {
18 return authenticated(currentSession);
20 if (unauthenticated != null) {
21 return unauthenticated() as T;
23 throw
Exception('Unauthenticated access');
final Function(ProposedTimeEntity pickedTimeRange) onPickTimeRange