Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions compass_app/app/lib/routing/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ GoRouter router(AuthRepository authRepository) => GoRouter(
GoRoute(
path: Routes.home,
builder: (context, state) {
// NOTE:
// HomeViewModel is created here and is not disposed.
// This is safe in this sample because HomeViewModel does not
// manage any resources that require disposal.
//
// In real applications, if a ViewModel manages streams,
// controllers, or subscriptions, it should be properly disposed.
// This can be handled using state management solutions such as
// Provider or Riverpod, or by managing lifecycle within a
// StatefulWidget.
final viewModel = HomeViewModel(
bookingRepository: context.read(),
userRepository: context.read(),
Expand Down