initSingleton static method

Future<void> initSingleton(
  1. DataStore dataStore
)

Initialize the singleton DataStore. This should be called before using the DataStore typically in main(). e.g. await DataStore.initSingleton(DataStoreRemote()); shorebird generate will generate a server() which calls this.

Implementation

static Future<void> initSingleton(DataStore dataStore) async {
  _singleton = dataStore;
  await _singleton!.init();
}