PlaceholderParsedValue constructor

PlaceholderParsedValue(
  1. String text,
  2. List<PlaceholderPart> parts
)

A container for a parsed text and its constituent Part objects.

This class holds the original placeholder expression (text) and the parsed structure (parts) used to resolve dynamic placeholders in text.

You typically obtain a ParsedValue when parsing a template-like string with placeholders, such as:

final parsedValue = ParsedValue('\#{greeting}, \#{user}!', [
  LiteralPart(''),
  PlaceholderPart('greeting'),
  LiteralPart(', '),
  PlaceholderPart('user'),
  LiteralPart('!')
]);

final resolved = parsedValue.resolve(context); // e.g. 'Hello, Alice!'

It delegates the resolution of each part to the PlaceholderPart.resolveAll method and rethrows any PlaceholderResolutionException with additional context about the original unresolved value.

This class is commonly used internally by the placeholder resolution engine.

Implementation

PlaceholderParsedValue(this.text, this.parts);