debugNameForSlot method Null safety

  1. @protected
String debugNameForSlot(
  1. S slot
)
protected">@protected

Returns the debug name for a given slot.

This method is called by debugDescribeChildren for each slot that is currently occupied by a child to obtain a name for that slot for debug outputs.

The default implementation calls EnumName.name on slot it it is an Enum value and toString if it is not.

Implementation

@protected
String debugNameForSlot(S slot) {
  if (slot is Enum) {
    return slot.name;
  }
  return slot.toString();
}