PlaceholderAbstractPart constructor

const PlaceholderAbstractPart(
  1. String _text
)

Base class for all PlaceholderPart implementations that represent a segment of a parsed placeholder expression.

This class provides common functionality for handling the raw text of the part and recursive resolution of nested placeholders.

Concrete subclasses (e.g., PlaceholderTextPart, PlaceholderPart) must implement resolution behavior by overriding resolve(...).

Example:

class PlaceholderPart extends AbstractPart {
  final String key;

  PlaceholderPart(this.key) : super('\#{#key}');

  @override
  String resolve(PartResolutionContext ctx) {
    return resolveRecursively(ctx, key) ?? ctx.handleUnresolvablePlaceholder(key, text());
  }
}

This class should not be used directly—extend it to define custom parts.

Implementation

const PlaceholderAbstractPart(this._text);