operator [] method

dynamic operator [](
  1. String arg
)

Implementation

dynamic operator [](String arg) {
  switch (arg) {
    default:
      throw Exception('Property $arg not supported');
  }
}