map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult mobile(
    1. NetworkTypeMobile value
    ),
  2. required TResult mobileRoaming(
    1. NetworkTypeMobileRoaming value
    ),
  3. required TResult none(
    1. NetworkTypeNone value
    ),
  4. required TResult other(
    1. NetworkTypeOther value
    ),
  5. required TResult wiFi(
    1. NetworkTypeWiFi value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(NetworkTypeMobile value) mobile,
  required TResult Function(NetworkTypeMobileRoaming value) mobileRoaming,
  required TResult Function(NetworkTypeNone value) none,
  required TResult Function(NetworkTypeOther value) other,
  required TResult Function(NetworkTypeWiFi value) wiFi,
}) {
  switch (getConstructor()) {
    case NetworkTypeMobile.constructor:
      return mobile.call(this as NetworkTypeMobile);
    case NetworkTypeMobileRoaming.constructor:
      return mobileRoaming.call(this as NetworkTypeMobileRoaming);
    case NetworkTypeNone.constructor:
      return none.call(this as NetworkTypeNone);
    case NetworkTypeOther.constructor:
      return other.call(this as NetworkTypeOther);
    case NetworkTypeWiFi.constructor:
      return wiFi.call(this as NetworkTypeWiFi);
  }
  throw StateError('not handled type Generator');
}