Session Overview
1. Overall Feature Overview
The Session feature is a cornerstone of the application, enabling users (both students and tutors) to manage their learning and teaching engagements. It encompasses functionalities for:
- Listing Sessions (
SessionList
): Users can view a list of their past, current, and upcoming sessions. This view includes filtering capabilities by date and session status, and allows users to search for specific sessions. - Creating Sessions (
SessionCreate
): Students can initiate the process of booking a new session. This involves selecting a tutor, choosing an available time slot from the tutor's schedule, adding any necessary details, reviewing the session information, and finally submitting the booking. - Viewing Session Details (
SessionDetail
): Users can view detailed information about a specific session, including participant IDs, scheduled times, status, and potentially engage in actions related to the session like starting, ending, or recording audio.
These sub-features are interconnected, with users typically navigating from the list to details, or creating a session which then appears in their list. Each part utilizes BLoCs for state management and interacts with core repositories for data persistence.
2. Session List Sub-Feature
2.1. Overview
The Session List sub-feature provides users with a comprehensive view of their scheduled, ongoing, completed, or cancelled sessions. It's designed to be interactive, allowing users to filter sessions by date and status, and to search for specific sessions. Each item in the list serves as an entry point to the SessionDetail
page.
2.2. Class Diagram (SessionList
)
Key Relationships:
SessionListView
provides theSessionListBloc
._SessionListContent
composesSessionListFilters
andSessionListItems
.SessionListFilters
allows users to change theSessionListFilter
and dispatchesSessionListFilterChanged
events to theSessionListBloc
.SessionListItems
listens to theSessionListBloc
for thefilteredSessions
and displays them. Tapping an item navigates to theSessionDetail
page.SessionListBloc
subscribes toSessionRepository
to get session data and applies theSessionListFilter
fromSessionListState
.
2.3. State Diagram (SessionListBloc
)
2.4. Sequence Diagram: Applying a Filter (SessionList
)
3. Session Create Sub-Feature
3.1. Overview
The Session Create sub-feature guides a student through a multi-step process to book a new tutoring session. This typically involves selecting a tutor, choosing an available time slot from that tutor's schedule, optionally adding more details, reviewing the complete session information, and finally submitting the request. The feature uses a modal interface (SessionCreateModal
) and a dedicated BLoC (SessionCreateBloc
) to manage the state of this creation flow.
3.2. Class Diagram (SessionCreate
)
Key Relationships:
SessionCreateModal
provides theSessionCreateBloc
.SessionCreateView
orchestrates the display of different step widgets (InitialStep
,SelectSessionStep
, etc.) based on theSessionCreateState.currentStep
.- Each step widget can dispatch events to the
SessionCreateBloc
(e.g.,Start
,SelectSession
,Submit
). SessionCreateBloc
interacts withTutorRepository
,UserRepository
, andSessionRepository
to fetch tutor data, user data (for tutor schedules), and to create the new session.
3.3. State Diagram (SessionCreateBloc
)
3.4. Sequence Diagram: Submitting a New Session (SessionCreate
)
4. Session Detail Sub-Feature
4.1. Overview
The Session Detail sub-feature allows users to view comprehensive information about a specific session they have selected from the SessionList
. This includes details like the session ID, status, participants (tutor and student IDs), scheduled start and end times, and duration. It also provides a placeholder for session-related actions, such as starting, ending, or recording audio for the session.
4.2. Class Diagram (SessionDetail
)
Key Relationships:
SessionDetailPage
provides theSessionDetailBloc
.SessionDetailView
listens to theSessionDetailBloc
and conditionally displays either_SessionDetailContent
(on success) or_ErrorView
._SessionDetailContent
displays session information using_InfoCard
and_InfoRow
widgets, and includes_ActionButtonsSection
._ActionButtonsSection
usesSimpleAudioRecorder
for audio recording functionality.SessionDetailBloc
interacts withSessionRepository
to fetch details for a specific session.
4.3. State Diagram (SessionDetailBloc
)
4.4. Sequence Diagram: Loading Session Details (SessionDetail
)
5. External Dependencies for Session Feature
The Session feature (across its List, Create, and Detail parts) utilizes several external packages:
flutter_bloc
:- Purpose: Core state management.
- Usage:
SessionListBloc
,SessionCreateBloc
, andSessionDetailBloc
are all built using this package to manage their respective states and business logic.BlocProvider
andBlocBuilder
(orBlocListener
) are used in the UI.
equatable
:- Purpose: Simplifies value equality comparisons for BLoC states and events.
- Usage: All BLoC states and events within the Session feature extend
Equatable
.
delayed_display
:- Purpose: Adds entrance animations.
- Usage: Used in
SessionCreateView
to animate the appearance of step content.
loading_indicator
:- Purpose: Provides a collection of loading indicator animations.
- Usage: Used in
SessionCreateView
for loading states (e.g.,LoadingTutors
).
flutter_staggered_animations
:- Purpose: Provides staggered animations for list items.
- Usage: Used in
SessionListItems
to animate the appearance of session tiles as they are loaded or filtered.
easy_date_timeline
:- Purpose: Provides a customizable horizontal date picker.
- Usage: Used in
SessionListFilters
for selecting a date to filter sessions.
intl
:- Purpose: Provides internationalization and localization utilities, including date/time formatting.
- Usage: Used for formatting dates and times in
SessionListFilters
,AvailableTimeSlots
(inSessionCreate
), and_SessionDetailContent
.
change_case
:- Purpose: Utility for converting string cases (e.g.,
snake_case
toTitle Case
). - Usage: Used in
SessionListFilters
to formatSessionStatus
enum names for display in choice chips.
- Purpose: Utility for converting string cases (e.g.,
flip_card_swiper
:- Purpose: Creates a swipable card interface with a flip animation.
- Usage: Used in
SelectSessionStep
(withinSessionCreate
) for displayingTutorCards
.
grouped_list
:- Purpose: Displays a list view with items grouped by a specified criterion.
- Usage: Used in
AvailableTimeSlots
(withinSessionCreate
) to group available time slots by day.
record
:- Purpose: Enables audio recording.
- Usage: Used by
SimpleAudioRecorder
in theSessionDetail
feature to record audio.
file_picker
:- Purpose: Allows users to pick files or save files to the device.
- Usage: Used by
SimpleAudioRecorder
in theSessionDetail
feature to allow users to save their recorded audio.
percent_indicator
(implicitly viaSessionCreateProgressBar
):- Purpose: Provides circular and linear progress indicators.
- Usage:
SessionCreateProgressBar
usesLinearPercentIndicator
from this package.
These packages enhance the functionality, user experience, and development efficiency of the Session feature.