我想这就是你想要的。要在多行上显示文本和方程,请使用以下代码。
Center(
child: SizedBox(
width: 300,
height: 200,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text('What are the solutions of the quadratic equation'),
SizedBox(height: 2),
Math.tex(
r'x^2+6x+8=0',
textStyle: TextStyle(fontSize: 25, color: Colors.black),
),
SizedBox(height: 2),
Text('this is some question text following the equation'),
],
),
),
);
要在一行中使用文本和方程 使用此
Center(
child: SizedBox(
width: 300,
height: 200,
child: Wrap(
direction: Axis.horizontal,
children: [
Text('What are the solutions of the quadratic equation '),
Math.tex(
r'x^2+6x+8=0',
textStyle: TextStyle(fontSize: 25, color: Colors.black),
),
Text(' this is some question text following the equation'),
],
),
),
);