Closed panmengma closed 3 years ago
I don't know if it's a bug or anything, but you have to pass a TextStyle
with a non-null color :
Math.tex(r'\frac a b', textStyle: TextStyle(color: Colors.black));
I don't know if it's a bug or anything, but you have to pass a
TextStyle
with a non-null color :
Math.tex(r'\frac a b', textStyle: TextStyle(color: Colors.black));
Thanks for your response.
I finally got the code running correctly following your suggestions.
What puzzles me is why the usage like Math.tex(r'\frac a b', mathStyle: MathStyle.display) , Math.tex(r'\frac a b',textStyle: TextStyle(fontSize: 42)) which is in the documentation will throws an error?
Depends on your testing environment, I think. If you provide a default color to your app text style, then it's all good. Otherwise you will encounter this error (at least, that's what I understood from my investigations).
I could submit a pull request to fix this one as it doesn't seem to be too complicated.
Depends on your testing environment, I think. If you provide a default color to your app text style, then it's all good. Otherwise you will encounter this error (at least, that's what I understood from my investigations).
I could submit a pull request to fix this one as it doesn't seem to be too complicated.
Yes, I agree with you.
And, Thanks for your work!
Sorry for the delay. Yeah, I can confirm confirm it is a bug. Thank you @Skyost !
Math.tex(r'\frac a b'); Math.tex(r'\frac a b', mathStyle: MathStyle.display); Math.tex(r'\frac a b', mathStyle: MathStyle.text);
The above code all will throw a same error: NoSuchMethodError: The getter 'color' was called on null. Receiver: null Tried calling: color
My development environment is win10+vscode.