putAndClean method

Future<bool> putAndClean({
  1. @required dynamic key,
  2. bool force = true,
  3. bool closeDrawer = true,
})

Put key and clean all

Implementation

Future<bool> putAndClean(
    {@required dynamic key,
    bool force = true,
    bool closeDrawer = true}) async {
  if (_interface != null) {
    if (!force && !await _interface!.onPut()) {
      return false;
    }
  }

  _onPut(stack.isNotEmpty ? stack.last.key : null, key);
  stack.clear();

  return await putPosit(key: key, force: force, closeDrawer: closeDrawer);
}