ContentBlockerTrigger constructor Null safety

ContentBlockerTrigger(
  1. {required String? urlFilter,
  2. bool? urlFilterIsCaseSensitive = false,
  3. List<ContentBlockerTriggerResourceType?> resourceType = const [],
  4. List<String> ifDomain = const [],
  5. List<String> unlessDomain = const [],
  6. List<ContentBlockerTriggerLoadType?> loadType = const [],
  7. List<String> ifTopUrl = const [],
  8. List<String> unlessTopUrl = const []}
)

Implementation

ContentBlockerTrigger({
  required String? urlFilter,
  bool? urlFilterIsCaseSensitive = false,
  List<ContentBlockerTriggerResourceType?> resourceType = const [],
  List<String> ifDomain = const [],
  List<String> unlessDomain = const [],
  List<ContentBlockerTriggerLoadType?> loadType = const [],
  List<String> ifTopUrl = const [],
  List<String> unlessTopUrl = const [],
}) {
  this.urlFilter = urlFilter;
  assert(this.urlFilter != null);
  this.resourceType = resourceType;
  this.urlFilterIsCaseSensitive = urlFilterIsCaseSensitive;
  this.ifDomain = ifDomain;
  this.unlessDomain = unlessDomain;
  assert(!(this.ifDomain!.isEmpty || this.unlessDomain!.isEmpty) == false);
  this.loadType = loadType;
  assert(this.loadType.length <= 2);
  this.ifTopUrl = ifTopUrl;
  this.unlessTopUrl = unlessTopUrl;
  assert(!(this.ifTopUrl!.isEmpty || this.unlessTopUrl!.isEmpty) == false);
}