highLightSpans function

List<InlineSpan> highLightSpans(
  1. String input, {
  2. String? language,
  3. bool autoDetectionLanguage = false,
  4. Map<String, TextStyle>? theme = const {},
  5. TextStyle? textStyle,
  6. int tabSize = 8,
})

Implementation

List<InlineSpan> highLightSpans(
  String input, {
  String? language,
  bool autoDetectionLanguage = false,
  Map<String, TextStyle>? theme = const {},
  TextStyle? textStyle,
  int tabSize = 8,
}) {
  return _convert(
      hi.highlight
          .parse(input,
              language: autoDetectionLanguage ? null : language,
              autoDetection: autoDetectionLanguage)
          .nodes!,
      theme ?? {},
      textStyle);
}