From e2f37dbe6668515fb2660024816365cfc9be6d18 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Sat, 7 Mar 2026 01:00:59 -0500 Subject: [PATCH] refactor: change singleton registrations to lazy singleton for improved performance --- .../skills/krow-mobile-architecture/SKILL.md | 8 ++++---- .github/PULL_REQUEST_TEMPLATE.md | 18 ++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.agents/skills/krow-mobile-architecture/SKILL.md b/.agents/skills/krow-mobile-architecture/SKILL.md index e27e743c..eccc0bb2 100644 --- a/.agents/skills/krow-mobile-architecture/SKILL.md +++ b/.agents/skills/krow-mobile-architecture/SKILL.md @@ -666,17 +666,17 @@ class StaffConnectorRepositoryImpl implements StaffConnectorRepository { class StaffMainModule extends Module { @override void binds(Injector i) { - i.addSingleton( + i.addLazySingleton( StaffConnectorRepositoryImpl.new, ); - i.addSingleton( + i.addLazySingleton( () => GetProfileCompletionUseCase( repository: i.get(), ), ); - i.addSingleton( + i.addLazySingleton( () => StaffMainCubit( getProfileCompletionUsecase: i.get(), ), @@ -772,7 +772,7 @@ StateError: Cannot emit new states after calling close ```dart // ✅ GOOD: Singleton registration -i.addSingleton( +i.addLazySingleton( () => ProfileCubit(useCase1, useCase2), ); diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c7a2d1c5..23463707 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,6 +2,14 @@ +--- + +## 🔗 Related Issues + + + +Closes # +Related to # --- @@ -33,15 +41,6 @@ --- -## 🔗 Related Issues - - - -Closes # -Related to # - ---- - ## ✅ Testing @@ -93,7 +92,6 @@ Related to # - [ ] Code quality and readability - [ ] Design patterns follow project conventions -- [ ] Test coverage is adequate - [ ] Performance implications reviewed - [ ] Security concerns addressed - [ ] Documentation is complete