fromString method

Membership? fromString(
  1. String val
)

Implementation

Membership? fromString(String val) {
  final override = {
    'ban': Membership.ban,
    'invite': Membership.invite,
    'join': Membership.join,
    'knock': Membership.knock,
    'leave': Membership.leave,
  }[val];
// ignore: unnecessary_this
  return this.contains(override) ? override : null;
}