processText method
Process Pendart text into a widget tree
Implementation
List<Widget> processText(String text, BuildContext context,
{bool isDarkMode = false,
Function(int, bool)? onCheckboxChanged,
bool enableCheckboxes = true}) {
// Use isDarkMode to determine text/background colors and other styling
final themeColors = isDarkMode ? _DarkThemeColors() : _LightThemeColors();
// Get token array from the preprocessed text
String preprocessedText = getPreprocessedText(text);
List<Token> tokenArray = getTokenArray(preprocessedText);
// Build widgets from tokens, passing the theme colors
return _buildWidgetsFromTokens(tokenArray, context,
enableCheckboxes: enableCheckboxes,
onCheckboxChanged: onCheckboxChanged,
themeColors: themeColors);
}