No Material widget found

后端 未结 5 949
轮回少年
轮回少年 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 00:59

    In my case I was using a hero widget Inside a scaffold like this

    Scaffold(
      body:Hero(
        child:ListView(
           children:[
               TextField(),
               ...
               ...
               ]
              )
            )
           );
    

    I simply moved the Hero Widget Outside Scaffold and it solved the problem

    Hero(
        child:Scaffold(
        body:ListView(
           children:[
               TextField(),
               ...
               ...
               ]
              )
           ));
    

提交回复
热议问题