dvStudioActionName function

String dvStudioActionName(
  1. DVPageNode node,
  2. Map<String, Object?> properties
)

What a node's action is called: its own words if it has any, else where it goes. Everything a person can press says what it is, so a box or an image someone linked in Studio is never a nameless target.

Implementation

String dvStudioActionName(DVPageNode node, Map<String, Object?> properties) {
  for (final String key in <String>['label', 'text', 'alt']) {
    final Object? value = properties[key];
    if (value != null && '$value'.trim().isNotEmpty) return '$value'.trim();
  }
  return 'Go to ${node.action?['to']}';
}