decorationStyles method

Map<String, Style> decorationStyles({
  1. String prefix = codeSyntaxDecorationPrefix,
})

Returns decoration styles keyed for use with editable code overlays.

Implementation

Map<String, Style> decorationStyles({
  String prefix = codeSyntaxDecorationPrefix,
}) {
  return Map<String, Style>.unmodifiable({
    if (theme.comment != null)
      codeSyntaxDecorationStyleKey('comment', prefix: prefix): theme.comment!,
    if (theme.commentPreproc != null)
      codeSyntaxDecorationStyleKey('comment.preproc', prefix: prefix):
          theme.commentPreproc!,
    if (theme.keyword != null)
      codeSyntaxDecorationStyleKey('keyword', prefix: prefix): theme.keyword!,
    if (theme.keywordType != null)
      codeSyntaxDecorationStyleKey('keyword.type', prefix: prefix):
          theme.keywordType!,
    if (theme.literal != null)
      codeSyntaxDecorationStyleKey('literal', prefix: prefix): theme.literal!,
    if (theme.literalNumber != null)
      codeSyntaxDecorationStyleKey('literal.number', prefix: prefix):
          theme.literalNumber!,
    if (theme.literalString != null)
      codeSyntaxDecorationStyleKey('literal.string', prefix: prefix):
          theme.literalString!,
    if (theme.name != null)
      codeSyntaxDecorationStyleKey('name', prefix: prefix): theme.name!,
    if (theme.nameAttribute != null)
      codeSyntaxDecorationStyleKey('name.attribute', prefix: prefix):
          theme.nameAttribute!,
    if (theme.nameBuiltin != null)
      codeSyntaxDecorationStyleKey('name.builtin', prefix: prefix):
          theme.nameBuiltin!,
    if (theme.nameClass != null)
      codeSyntaxDecorationStyleKey('name.class', prefix: prefix):
          theme.nameClass!,
    if (theme.nameConstant != null)
      codeSyntaxDecorationStyleKey('name.constant', prefix: prefix):
          theme.nameConstant!,
    if (theme.nameFunction != null)
      codeSyntaxDecorationStyleKey('name.function', prefix: prefix):
          theme.nameFunction!,
    if (theme.nameTag != null)
      codeSyntaxDecorationStyleKey('name.tag', prefix: prefix):
          theme.nameTag!,
    if (theme.operator != null)
      codeSyntaxDecorationStyleKey('operator', prefix: prefix):
          theme.operator!,
    if (theme.punctuation != null)
      codeSyntaxDecorationStyleKey('punctuation', prefix: prefix):
          theme.punctuation!,
    if (theme.genericDeleted != null)
      codeSyntaxDecorationStyleKey('generic.deleted', prefix: prefix):
          theme.genericDeleted!,
    if (theme.genericEmph != null)
      codeSyntaxDecorationStyleKey('generic.emphasis', prefix: prefix):
          theme.genericEmph!,
    if (theme.genericInserted != null)
      codeSyntaxDecorationStyleKey('generic.inserted', prefix: prefix):
          theme.genericInserted!,
    if (theme.genericStrong != null)
      codeSyntaxDecorationStyleKey('generic.strong', prefix: prefix):
          theme.genericStrong!,
    if (theme.genericSubheading != null)
      codeSyntaxDecorationStyleKey('generic.subheading', prefix: prefix):
          theme.genericSubheading!,
  });
}