number static method

PersistroLightro<num> number(
  1. String key, {
  2. num initial = 0.0,
  3. bool autoSave = true,
})

Creates a persistent numeric state container.

Implementation

static PersistroLightro<num> number(
  String key, {
  num initial = 0.0,
  bool autoSave = true,
}) {
  return PersistroLightro<num>(
    key: key,
    initial: initial,
    decoder: (json) => num.parse(json),
    encoder: (value) => value.toString(),
    autoSave: autoSave,
  );
}