config property

MarkdownContentConfig get config

The resolved configuration; throws StateError, in release builds too, when neither form was supplied.

Implementation

MarkdownContentConfig get config {
  final MarkdownContentConfig? explicitConfig = _config;
  if (explicitConfig != null) {
    return explicitConfig;
  }
  final String? filePath = _legacyFilePath;
  final String? imageDir = _legacyImageDir;
  if (filePath == null || imageDir == null) {
    throw StateError(
      'MarkdownContentPage was constructed without a `config:` and without '
      'the deprecated `filePath:`/`imageDir:` pair; it has nothing to render.',
    );
  }
  return _LegacyMarkdownContentConfig(
    filePath: filePath,
    imageDir: imageDir,
    docsDesc: _legacyDocsDesc ?? const <Map<String, String>>[],
  );
}