parseKey method

List<String?> parseKey(
  1. String key
)

Implementation

List<String?> parseKey(String key) {
  // examples: albedoTexture, Light[2].position, or Foo.bar
  final regex = RegExp(r'^(\w+)(?:\[(\d+)\])?(?:\.(\w+))?$');
  return regex.firstMatch(key)?.groups([1, 2, 3]) ?? [];
}