I have a lot of part of library. But all of the same type (extends Part)

**part1.dart**

```dart
part of Parts;
class Part1 extends Part { /* ... */ }
parts.add((varOfSomeClass){ return new Part1(varOfSomeClass + 1); });

```

**part2.dart**

```dart
part of Parts;
class Part2 extends Part { /* ... */ }
parts.add((varOfSomeClass){ return new Part2(varOfSomeClass - 1); });

```

**parts.dart**

```dart
library Parts;
part "Part1.dart";
part "Part2.dart";
List<Function> parts = new List<Function>();
class Parts {
  getPart(int index) {
    if (parts.contains(index)) {
      return parts[index](someVarOfThisClass);
    }
  }
}

```

OUTPUT: error: unexpected token 'parts'

How to get all included factories without create instance all the Part classes?

For example need to do:

**BMW.dart**

```dart
part of Auto;
class BMW {
    String color;
    BMW(this.color);
}
list.add((color){
    return new BMW(color);
});

```

**Lada.dart**

```dart
part of Auto;
class Lada {
    List<int> color;
}
list.add((color){
    var auto = new Lada();
    auto.color = hex2rgb(color);
    return auto;
});

```

**Auto.dart**

```dart
library Auto;
class Auto {
    getByIndex(int index) {
        if (list.contains(index)) {
            return list[index](color);
        }
        return null;
    }
}

```