createFieldIndex method
Implementation
Map<String, int> createFieldIndex() {
var identifierPattern = RegExp(r'^[a-zA-Z][a-zA-Z0-9_]*$');
var fieldIndex = Map<String, int>();
for (var i = 0; i < fieldPackets.length; i++) {
var name = fieldPackets[i].name!;
if (identifierPattern.hasMatch(name)) {
fieldIndex[name] = i;
}
}
return fieldIndex;
}