我在使用flutter_tex时出现了黑色背景,如何设置为白色背景?
I have a black background when using flutter_tex, how do I set a white background?
听起来是个很简单的问题,但是代码就是行不通。我说“白”,app说“黑”,不知道为什么。
我在 flutter_tex 4.0.3 中使用 Flutter 2.5.1(我想显示方程式)。
这是我的代码:
class Maths extends StatelessWidget {
const Maths({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
// this is the example from the documentation on pub.dev (simplified)
return TeXView(
child: const TeXViewDocument(
r"""
When \(a \ne 0 \), there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$""",
style: TeXViewStyle(
backgroundColor: Colors.red, // works, except for Colors.white.
contentColor: Colors.blue, // works perfectly fine
),
),
style: const TeXViewStyle(
backgroundColor: Colors.red, // works, except for Colors.white
),
);
}
}
唯一的问题是方程后面的黑底,我只想要白色;(
请帮助我,我对 flutter_tex
一点都不懂
好的,我解决了我的问题。这显然是我一生中见过的最奇怪的错误。问题出在我的 android phone.......
的黑暗模式
我必须找到我们现在如何强制白色模式...
听起来是个很简单的问题,但是代码就是行不通。我说“白”,app说“黑”,不知道为什么。
我在 flutter_tex 4.0.3 中使用 Flutter 2.5.1(我想显示方程式)。
这是我的代码:
class Maths extends StatelessWidget {
const Maths({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
// this is the example from the documentation on pub.dev (simplified)
return TeXView(
child: const TeXViewDocument(
r"""
When \(a \ne 0 \), there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$""",
style: TeXViewStyle(
backgroundColor: Colors.red, // works, except for Colors.white.
contentColor: Colors.blue, // works perfectly fine
),
),
style: const TeXViewStyle(
backgroundColor: Colors.red, // works, except for Colors.white
),
);
}
}
唯一的问题是方程后面的黑底,我只想要白色;(
请帮助我,我对 flutter_tex
一点都不懂好的,我解决了我的问题。这显然是我一生中见过的最奇怪的错误。问题出在我的 android phone.......
的黑暗模式我必须找到我们现在如何强制白色模式...