flutter - 如何在 flutter math_fork 库的内部表达式中添加自定义值

标签 flutter flutter-tex

class ResultPage extends StatefulWidget {
    DataModel dataModel;
    ResultPage({Key? key, required this.dataModel}) : super(key: key);

    @override
    _ResultPageState createState() => _ResultPageState();
}

class _ResultPageState extends State<ResultPage> {
    @override
    Widget build(BuildContext context) {
        return Scaffold(
            body: Math.tex("m=/frac "${widget.datamodel.value}"")
        );
    }
}

但是 math.tex 在 flutter 中显示如何在任何方程中传递自定义值的错误

最佳答案

class ResultPage extends StatefulWidget {
  DataModel dataModel;
   ResultPage({Key? key, required this.dataModel}) : super(key: key);

  @override
   _ResultPageState createState() => _ResultPageState();
    }

    class _ResultPageState extends State<ResultPage> {
           @override
    Widget build(BuildContext context) {
     return Scaffold( 
  body:Math.tex(
            "m = ${r'\frac'} {${widget.datamodel.value1}} 
               {$widget.datamodel.value2}",
            textStyle: textStyle,
          ),

    );}}

这就是如何在 flutter math_fork 的方程中添加自定义值

关于flutter - 如何在 flutter math_fork 库的内部表达式中添加自定义值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70363753/

相关文章:

unit-testing - 有没有办法通过 NumberFormat 比较格式化值?

firebase - 如何使用底部导航栏在flutter中的两个页面之间传递数据

FirebaseAuth 禁用用户检查并注销?

flutter - 如何在Dart中检查 map 是否为空

flutter - 预期为 'List<DropdownMenuItem<Color>>' 类型的值,但得到了 'MappedListIterable<Color, DropdownMenuItem<Color>>' 类型的值