ShowBannerMessageExtensionEvent.from constructor

ShowBannerMessageExtensionEvent.from(
  1. DevToolsExtensionEvent event
)

Implementation

factory ShowBannerMessageExtensionEvent.from(DevToolsExtensionEvent event) {
  assert(event.type == DevToolsExtensionEventType.showBannerMessage);
  final eventData = event.data!;
  final id = eventData.checkValid<String>(_idKey);
  final message = eventData.checkValid<String>(_messageKey);
  final type = eventData.checkValid<String>(_bannerMessageTypeKey);
  final extensionName = eventData.checkValid<String>(_extensionNameKey);
  final ignoreIfAlreadyDismissed =
      (eventData[_ignoreIfAlreadyDismissedKey] as bool?) ?? true;
  return ShowBannerMessageExtensionEvent(
    id: id,
    bannerMessageType: type,
    message: message,
    extensionName: extensionName,
    ignoreIfAlreadyDismissed: ignoreIfAlreadyDismissed,
  );
}