parseStyleDisplay method Null safety

void parseStyleDisplay(
  1. BuildMetadata meta,
  2. String? value
)

Parses display inline style.

Implementation

void parseStyleDisplay(BuildMetadata meta, String? value) {
  switch (value) {
    case kCssDisplayBlock:
      final displayBlock = _styleDisplayBlock ??= DisplayBlockOp(this);
      meta.register(displayBlock);
      break;
    case kCssDisplayInlineBlock:
      final displayInlineBlock = _styleDisplayInlineBlock ??= BuildOp(
        onTree: (meta, tree) {
          final built = buildColumnPlaceholder(meta, tree.build());
          if (built != null) {
            WidgetBit.inline(
              tree.parent!,
              built,
              alignment: PlaceholderAlignment.baseline,
            ).insertBefore(tree);
          }
          tree.detach();
        },
        priority: BuildOp.kPriorityMax,
      );
      meta.register(displayInlineBlock);
      break;
    case kCssDisplayNone:
      final displayNone = _styleDisplayNone ??= BuildOp(
        onTree: (_, tree) => tree.detach(),
        priority: BuildOp.kPriorityMax,
      );
      meta.register(displayNone);
      break;
    case kCssDisplayTable:
      meta.register(TagTable(this, meta).op);
      break;
  }
}