create static method

Map<String, TextStyle> create({
  1. required Color color,
  2. required Color backgroundColor,
  3. TextStyle? keyword,
  4. TextStyle? operator,
  5. TextStyle? function,
  6. TextStyle? funtionParams,
  7. TextStyle? funtionParamsTyping,
  8. TextStyle? comment,
  9. TextStyle? quote,
  10. TextStyle? constructorString,
  11. TextStyle? doctag,
  12. TextStyle? formula,
  13. TextStyle? section,
  14. TextStyle? name,
  15. TextStyle? selectorTag,
  16. TextStyle? deletion,
  17. TextStyle? literal,
  18. TextStyle? string,
  19. TextStyle? regexp,
  20. TextStyle? attribute,
  21. TextStyle? addition,
  22. TextStyle? metaString,
  23. TextStyle? builtIn,
  24. TextStyle? variable,
  25. TextStyle? patternMatch,
  26. TextStyle? patternMatchConstructor,
  27. TextStyle? moduleAccessModule,
  28. TextStyle? subst,
  29. TextStyle? titleClass,
  30. TextStyle? classTitle,
  31. TextStyle? attr,
  32. TextStyle? templateVariable,
  33. TextStyle? type,
  34. TextStyle? selectorClass,
  35. TextStyle? selectorAttr,
  36. TextStyle? selectorPseudo,
  37. TextStyle? number,
  38. TextStyle? symbol,
  39. TextStyle? bullet,
  40. TextStyle? link,
  41. TextStyle? meta,
  42. TextStyle? selectorId,
  43. TextStyle? title,
})

Create a custom theme for code_forge instead of using prebuilt ones from the re_highlight package.

Implementation

static Map<String, TextStyle> create({
  required Color color,
  required Color backgroundColor,
  TextStyle? keyword,
  TextStyle? operator,
  TextStyle? function,
  TextStyle? funtionParams,
  TextStyle? funtionParamsTyping,
  TextStyle? comment,
  TextStyle? quote,
  TextStyle? constructorString,
  TextStyle? doctag,
  TextStyle? formula,
  TextStyle? section,
  TextStyle? name,
  TextStyle? selectorTag,
  TextStyle? deletion,
  TextStyle? literal,
  TextStyle? string,
  TextStyle? regexp,
  TextStyle? attribute,
  TextStyle? addition,
  TextStyle? metaString,
  TextStyle? builtIn,
  TextStyle? variable,
  TextStyle? patternMatch,
  TextStyle? patternMatchConstructor,
  TextStyle? moduleAccessModule,
  TextStyle? subst,
  TextStyle? titleClass,
  TextStyle? classTitle,
  TextStyle? attr,
  TextStyle? templateVariable,
  TextStyle? type,
  TextStyle? selectorClass,
  TextStyle? selectorAttr,
  TextStyle? selectorPseudo,
  TextStyle? number,
  TextStyle? symbol,
  TextStyle? bullet,
  TextStyle? link,
  TextStyle? meta,
  TextStyle? selectorId,
  TextStyle? title,
}) {
  return {
    'root': TextStyle(color: color, backgroundColor: backgroundColor),
    'keyword': keyword ?? TextStyle(color: keyword?.color),
    'operator': operator ?? TextStyle(color: operator?.color),
    'pattern-match': patternMatch ?? TextStyle(color: patternMatch?.color),
    'pattern-match-constructor':
        patternMatchConstructor ??
        TextStyle(color: patternMatchConstructor?.color),
    'function': function ?? TextStyle(color: function?.color),
    'function-params':
        funtionParams ?? TextStyle(color: funtionParams?.color),
    'function-params-typing':
        funtionParamsTyping ?? TextStyle(color: funtionParamsTyping?.color),
    'module-access-module':
        moduleAccessModule ?? TextStyle(color: moduleAccessModule?.color),
    'constructor-string':
        constructorString ?? TextStyle(color: constructorString?.color),
    'comment':
        comment ??
        TextStyle(color: comment?.color, fontStyle: FontStyle.italic),
    'quote':
        quote ?? TextStyle(color: quote?.color, fontStyle: FontStyle.italic),
    'doctag': doctag ?? TextStyle(color: doctag?.color),
    'formula': formula ?? TextStyle(color: formula?.color),
    'section': section ?? TextStyle(color: section?.color),
    'name': name ?? TextStyle(color: name?.color),
    'selector-tag': selectorTag ?? TextStyle(color: selectorTag?.color),
    'deletion': deletion ?? TextStyle(color: deletion?.color),
    'subst': subst ?? TextStyle(color: subst?.color),
    'literal': literal ?? TextStyle(color: literal?.color),
    'string': string ?? TextStyle(color: string?.color),
    'regexp': regexp ?? TextStyle(color: regexp?.color),
    'addition': addition ?? TextStyle(color: addition?.color),
    'attribute': attribute ?? TextStyle(color: attribute?.color),
    'meta-string': metaString ?? TextStyle(color: metaString?.color),
    'built_in': builtIn ?? TextStyle(color: builtIn?.color),
    'title.class_': titleClass ?? TextStyle(color: titleClass?.color),
    'class-title': classTitle ?? TextStyle(color: classTitle?.color),
    'attr': attr ?? TextStyle(color: attr?.color),
    'variable': variable ?? TextStyle(color: variable?.color),
    'template-variable':
        templateVariable ?? TextStyle(color: templateVariable?.color),
    'type': type ?? TextStyle(color: type?.color),
    'selector-class': selectorClass ?? TextStyle(color: selectorClass?.color),
    'selector-attr': selectorAttr ?? TextStyle(color: selectorAttr?.color),
    'selector-pseudo':
        selectorPseudo ?? TextStyle(color: selectorPseudo?.color),
    'number': number ?? TextStyle(color: number?.color),
    'symbol': symbol ?? TextStyle(color: symbol?.color),
    'bullet': bullet ?? TextStyle(color: bullet?.color),
    'link': link ?? TextStyle(color: link?.color),
    'meta': meta ?? TextStyle(color: meta?.color),
    'selector-id': selectorId ?? TextStyle(color: selectorId?.color),
    'title': title ?? TextStyle(color: title?.color),
    'emphasis': TextStyle(fontStyle: FontStyle.italic),
    'strong': TextStyle(fontWeight: FontWeight.bold),
  };
}