Skip to content

Commit d1d08c2

Browse files
committed
Fix remaining registerLazySingleton in tutorial markdown files
Changed to registerSingleton for consistency in: - getting_started.md - Main counter example - your_first_watch_functions.md - Try It Yourself section - debugging_tracing.md - Troubleshooting examples (2 instances) Kept registerLazySingleton in advanced_integration.md as those teach advanced patterns (scopes, named instances, async init) where lazy singletons are appropriate.
1 parent de70006 commit d1d08c2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/documentation/watch_it/debugging_tracing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ get_it: Object/factory with type TodoManager is not registered inside GetIt
171171
```dart
172172
void main() {
173173
// Register BEFORE runApp
174-
di.registerLazySingleton<TodoManager>(() => TodoManager());
174+
di.registerSingleton<TodoManager>(TodoManager());
175175
176176
runApp(MyApp());
177177
}
@@ -372,7 +372,7 @@ class DebugWidget extends WatchingWidget {
372372
373373
// Test it
374374
void main() {
375-
di.registerLazySingleton<Manager>(() => Manager());
375+
di.registerSingleton<Manager>(Manager());
376376
377377
runApp(MaterialApp(
378378
home: Scaffold(

docs/documentation/watch_it/getting_started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CounterManager {
3939

4040
// 2. Register it in get_it
4141
void main() {
42-
di.registerLazySingleton<CounterManager>(() => CounterManager());
42+
di.registerSingleton<CounterManager>(CounterManager());
4343
runApp(MyApp());
4444
}
4545

docs/documentation/watch_it/your_first_watch_functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Add a todo? Widget rebuilds automatically. No `setState`, no `StreamBuilder`.
5757

5858
2. Register it:
5959
```dart
60-
di.registerLazySingleton<MyManager>(() => MyManager());
60+
di.registerSingleton<MyManager>(MyManager());
6161
```
6262

6363
3. Watch it:

0 commit comments

Comments
 (0)