isFirstRun static method

Future<bool> isFirstRun([
  1. String key = isFirstRunKey
])

Check app first run in the device

Implementation

static Future<bool> isFirstRun([String key = isFirstRunKey]) async {
  final prefs = await SharedPreferences.getInstance();
  final isFirstTime = prefs.get(key) == null;
  if (isFirstTime) {
    /// since its the first time , set the value to false;
    prefs.setBool(key, false);
  }
  return isFirstTime;
}