boolean static method

PersistroMastro<bool> boolean(
  1. String key, {
  2. bool initial = false,
  3. bool autoSave = true,
})

Creates a persistent boolean state container.

Implementation

static PersistroMastro<bool> boolean(
  String key, {
  bool initial = false,
  bool autoSave = true,
}) {
  return PersistroMastro<bool>(
    key: key,
    initial: initial,
    decoder: (json) => json.toLowerCase() == 'true',
    encoder: (value) => value.toString(),
    autoSave: autoSave,
  );
}