getBlocksExceptHeader method

EasyAttributeStyles getBlocksExceptHeader({
  1. bool getOnlyDefaults = false,
})

Returns all the blocks contained in this EasyAttributeStyles except the header one

Implementation

EasyAttributeStyles getBlocksExceptHeader({bool getOnlyDefaults = false}) {
  final Map<String, EasyAttribute<Object?>> blocks = getAll({
    EasyAttribute.codeblock.key,
    EasyAttribute.blockquote.key,
    EasyAttribute.list.key,
    if (!getOnlyDefaults)
      ...values.map<String>((e) =>
          e.isInline || e.key == EasyAttribute.header.key ? '' : e.key),
  }).map<Map<String, EasyAttribute<Object?>>>(
      (EasyAttribute<Object?> element) {
    return <String, EasyAttribute<Object?>>{element.key: element};
  }).reduce((Map<String, EasyAttribute<Object?>> a,
          Map<String, EasyAttribute<Object?>> b) =>
      <String, EasyAttribute<Object?>>{...a, ...b});
  return EasyAttributeStyles(
    attributes: blocks,
  );
}