toWidget method
Implementation
@override
Widget toWidget(RenderContext context) {
texStr = parseMathRecursive(element, r'');
return Container(
width: context.parser.shrinkWrap ? null : MediaQuery.of(context.buildContext).size.width,
child: Math.tex(
texStr ?? '',
mathStyle: MathStyle.display,
textStyle: context.style.generateTextStyle(),
onErrorFallback: (FlutterMathException e) {
if (context.parser.onMathError != null) {
return context.parser.onMathError!.call(texStr ?? '', e.message, e.messageWithType);
} else {
return Text(e.message);
}
},
)
);
}