stashValue method

Future<bool> stashValue(
  1. String key,
  2. dynamic value
)

Implementation

Future<bool> stashValue(String key, dynamic value) async
{
  bool ok = true;
  try
  {
    // key must be supplied
    if (S.isNullOrEmpty(key)) return ok;

    // write application stash entry
    _stash.map[key] = value;

    // save to the hive
    await _stash.upsert();

    // set observable
    stash.setObservable(key, value);
  }
  catch(e)
  {
    // stash failure always returns true
    ok = true;
  }
  return ok;
}