No Material widget found

后端 未结 5 946
轮回少年
轮回少年 2020-12-24 00:11

I am new to Flutter and I was trying do execute the example here. I just want to use the TextField widget to get some user input. The issue is that I get a \"No Material wid

5条回答
  •  自闭症患者
    2020-12-24 01:10

    The easy fix is:

    Instead of using:

    void main() {
      runApp(new MyApp());
    }
    

    You should use:

    void main() => runApp(
      MaterialApp(
        home: MyApp()
      )
    );
    

    Hope this helps you!

提交回复
热议问题