update method

bool update(
  1. String route,
  2. TId id,
  3. dynamic value
)

Updates a value for a given route and ID.

  • route: The route where the value should be updated.
  • id: The ID associated with the value.
  • value: The new value to be set.

Returns:

  • true if the value was updated successfully, or false if the route or ID was not found.

Implementation

bool update(String route, TId id, dynamic value) {
  if (_data.containsKey(route) && _data[route]!.containsKey(id)) {
    value['id'] = id.toString();
    _data[route]![id] = value;
    return true;
  }
  return false;
}