addEntityType method

List<String> addEntityType(
  1. String? entity
)

Add entity type to the block

Implementation

List<String> addEntityType(String? entity) {
  List<String> copiedTypes =
      (jsonDecode(jsonEncode(this.entityTypes)) as List)
          .map((e) => e as String)
          .toList();
  if (entity != null) {
    return copiedTypes..add(entity);
  } else {
    return copiedTypes;
  }
}