I'm trying to create elevated buttons that have equations on them. Here's the stripped down code that I have thus far:
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
const Padding(padding: EdgeInsets.all(10)),
Flexible(
fit: FlexFit.tight,
flex: 10,
child: ElevatedButton(
style: getOptionButtonStyle(0),
onPressed: () =>
{debugPrint("${context.size}"), updateSelection(1)},
child: TeXView(
renderingEngine: TeXViewRenderingEngine.katex(),
child: TeXViewDocument(
r"""$$0$$""",
style: TeXViewStyle(
textAlign: TeXViewTextAlign.center,
fontStyle: TeXViewFontStyle(
fontSize: 10, sizeUnit: TeXViewSizeUnit.pt),
),
),
),
),
),
const Padding(padding: EdgeInsets.all(10)),
Flexible(
fit: FlexFit.tight,
flex: 10,
child: ElevatedButton(
style: getOptionButtonStyle(1),
onPressed: () =>
{debugPrint("${context.size}"), updateSelection(3)},
child: TeXView(
renderingEngine: TeXViewRenderingEngine.katex(),
child: TeXViewDocument(r"""$$1$$""",
style: TeXViewStyle(
textAlign: TeXViewTextAlign.center,
fontStyle: TeXViewFontStyle(
fontSize: 10, sizeUnit: TeXViewSizeUnit.pt),
),
),
),
),
),
const Padding(padding: EdgeInsets.all(10)),
],
),
Unfortunately, this only displays the second button properly, the first has some squiggles that are almost invisible on the right:
I've tried changing the rendering engine to mathjax, added and removed padding and margins in the style, but no luck.
Any idea what is going on, and how to fix it?
Thanks!
Update: it turns out that this behaviour is when I run it on chrome (web). Running on my phone renders perfectly! So: what settings could be affecting this?
=> By using Media Query