isFirstRun method

Future<bool?> isFirstRun()

Checks if the app is being run for the first time.

Returns a Future<bool?> that is true if it's the first run, false if it's not, or null if the value has not been set.

Implementation

Future<bool?> isFirstRun() async {
  final sharedPreferences = await SharedPreferences.getInstance();
  return sharedPreferences.getBool(firstRunKey);
}