initialize method

Future<void> initialize()

Call this method once in main.dart to initialize the package.

Implementation

Future<void> initialize() async {
  _prefs = await SharedPreferences.getInstance();

  // Check if this is the first time we're running this
  if (_prefs!.getString(_StorageKeys.firstInstallDate) == null) {
    await _prefs!.setString(
      _StorageKeys.firstInstallDate,
      DateTime.now().toIso8601String(),
    );
  }
}