diff --git a/compass_app/app/lib/routing/router.dart b/compass_app/app/lib/routing/router.dart index 1ed94ed02..381a3945f 100644 --- a/compass_app/app/lib/routing/router.dart +++ b/compass_app/app/lib/routing/router.dart @@ -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(),