fromRawValue static method

IaCardLinkEvent fromRawValue(
  1. String rawValue
)

Creates an instance from a raw string value.

Implementation

static IaCardLinkEvent fromRawValue(String rawValue) {
  switch (rawValue) {
    case 'willExitCardlink':
      return IaCardLinkEvent.willExit;
    case 'willStartScanning':
      return IaCardLinkEvent.willStartScanning;
    case 'failedToInitialize':
      return IaCardLinkEvent.failedToInitialize;
    case 'goToCart':
      return IaCardLinkEvent.goToCart;
    case 'openTermsAndConditions':
      return IaCardLinkEvent.openTermsAndConditions;
    case 'cardSaved':
      return IaCardLinkEvent.cardSaved;
    default:
      throw ArgumentError('Unknown CardLink event: $rawValue');
  }
}