create static method
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,
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),
};
}