setDateTime method

Future<void> setDateTime(
  1. String prefKey,
  2. DateTime value
)

Implementation

Future<void> setDateTime (String prefKey, DateTime value) async {
  final SharedPreferences prefs = await SharedPreferences.getInstance();
  Pref p = getPref (prefKey);
  if (p != null)
    await prefs.setString(prefKey, value.toIso8601String());
}