getNamed method
Implementation
Message? getNamed(
List<Node> parts,
String id,
List<String> arguments,
) {
final messages = parts
.where((e) =>
e.children[0].type == ST.identifier && e.children[0].value == id)
.map((e) => e.children.firstWhere((e) => e.type == ST.message))
.map((e) => MessageParser.parseNode(e, arguments))
.whereType<Message>();
if (messages.isNotEmpty) {
return messages.first;
}
return null;
}