Direction? fromString(String val) { final override = { 'b': Direction.b, 'f': Direction.f, }[val]; // ignore: unnecessary_this return this.contains(override) ? override : null; }