setFlag method

void setFlag(
  1. String name,
  2. bool enable
)

Adds or removes the flag with the specified name to/from this message depending on enable.

Note that this only affects this message instance and is not persisted or reported to the mail service automatically.

Implementation

// ignore: avoid_positional_boolean_parameters
void setFlag(String name, bool enable) {
  if (enable == true) {
    addFlag(name);
  } else {
    removeFlag(name);
  }
}