I have a class that helps me handle the sharedpreferences:

```
class SharedPref {
  static late final SharedPreferences prefs;

  static initialize() async {
    prefs = await SharedPreferences.getInstance();
  }

  SharedPref._();

  static Future<void> save(String key, String value) async {
    await prefs.setString(key, value);
  }

  // more methods that help me to save/load values...
}

```

Then I have a testing function:

```
class MockNavigatorObserver  extends Mock implements NavigatorObserver {}

void main() {
  testWidgets('Button is present and triggers navigation after tapped',
          (WidgetTester tester) async {

        final mockObserver = MockNavigatorObserver();
        await tester.pumpWidget(
          MaterialApp(
            home: FirstPage(),
            navigatorObservers: [mockObserver],
          ),
        );

        expect(find.byType(RaisedButton), findsOneWidget);
        await tester.tap(find.byType(RaisedButton));
        await tester.pumpAndSettle();

        expect(find.byType(MyDetailedPage), findsOneWidget);
      });
}

```

Whenever I run the test:

```
The following LateError was thrown running a test:
LateInitializationError: Field 'prefs' has not been initialized.

```

How am I supposed to initialize that? I called the `SharedPref.initialize();` before the `final mockObserver...` but made no change.

Thanks in advance.