getInterfaceIcon method

Widget getInterfaceIcon({
  1. required BuildContext context,
  2. required GlobalKey<State<StatefulWidget>> anchor,
})

The Icon displayed for this interface

Will use interfaceColor by default

Will switch between Icons.radio_button_unchecked and Icons.radio_button_checked depending on if a node is connected to this interface

Implementation

Widget getInterfaceIcon({
  required BuildContext context,
  required GlobalKey anchor,
}) {
  if (interfaceIconBuilder != null) {
    return interfaceIconBuilder!(context, anchor, this);
  }

  final icon = connectedInterface == null
      ? Icons.radio_button_unchecked
      : Icons.radio_button_checked;

  return Icon(
    icon,
    key: anchor,
    color: interfaceColor,
    size: 15,
  );
}