visitorExposed method

Future<void> visitorExposed()

Implementation

Future<void> visitorExposed() async {
  // Before expose whe should check the Type
  Modification? modification =
      this._visitorDelegate.getFlagModification(this._key);
  if (modification != null) {
    if (modification.value == null || _isSameType(modification.value)) {
      Flagship.logger(Level.DEBUG, "Send activate for the flag: " + _key);

      // Update modification with default value
      modification.defaultValue = this._defaultValue;
      // Activate flag
      this._visitorDelegate.activateFlag(modification);
    } else {
      Flagship.logger(Level.DEBUG,
          "Exposed aborted, because the flagValue type is not the same as default value");
    }
  } else {
    Flagship.logger(Level.DEBUG,
        "Flag: " + _key + "not found, the activate won't be sent");
  }
}