htmlId property

String htmlId
override

Implementation

@override
String get htmlId {
  if (element.enclosingElement != null) {
    var enclosingName = element.enclosingElement.name;
    if (element.enclosingElement is GenericFunctionTypeElement) {
      // TODO(jcollins-g): Drop when GenericFunctionTypeElement populates name.
      // Also, allowing null here is allowed as a workaround for
      // dart-lang/sdk#32005.
      for (var e = element.enclosingElement;
          e.enclosingElement != null;
          e = e.enclosingElement) {
        enclosingName = e.name;
        if (enclosingName != null && enclosingName.isNotEmpty) break;
      }
    }
    return '$enclosingName-param-$name';
  } else {
    return 'param-$name';
  }
}