startPreferences static method

Future<void> startPreferences()

Inicializa las preferencias compartidas para guardar y cargar las configuraciones del timer.

Implementation

static Future<void> startPreferences() async {
  preferences = await SharedPreferences.getInstance();
  if (preferences.getKeys().isEmpty) {
    await preferences.setBool("hideRunningTime", false);
    await preferences.setBool("recordTimeAlert", false);
    await preferences.setBool("bestAverageAlert", false);
    await preferences.setBool("worstTimeAlert", false);
    await preferences.setBool("isActiveInspection", true);
    await preferences.setInt("inspectionSeconds", 15);
    await preferences.setBool("alertAt8And12Seconds", false);
    await preferences.setString("inspectionAlertType", InspectionAlertType.vibrant.toString());
  }
}