Firebase 颤振底部导航栏和签出问题

Firebase 颤振底部导航栏和签出问题,firebase,flutter,navigation,Firebase,Flutter,Navigation,我试图在其中一个页面上设置注销按钮,但每当我在页面底部有一个按钮时,NavigationBarItem就会消失 class Profile extends StatefulWidget { //final Function(User) onSignOut; //Profile({@required this.onSignOut}); Profile({Key key}) : super(key: key); @override _ProfileState createSta

我试图在其中一个页面上设置注销按钮,但每当我在页面底部有一个按钮时,NavigationBarItem就会消失

class Profile extends StatefulWidget {
  //final Function(User) onSignOut;
  //Profile({@required this.onSignOut});
  Profile({Key key}) : super(key: key);

  @override
  _ProfileState createState() => _ProfileState();
}
问题是我不能同时编写Profile({@required this.onSignOut})和Profile({Key}):super(Key:Key)。如果我使用第一个,我有没有任何导航栏的注销屏幕,但如果我使用第二个,我将有导航栏,但我不能添加onsignout。如果我两者都用 配置文件({@required this.onSignOut,Key}):超级(Key:Key)

当我单击“注销”按钮时,这将给我错误信息。my github中提供了更多代码:


谢谢

将代码更改为此,它应该可以工作:

class Profile extends StatefulWidget {
  final Function(User) onSignOut;
 
  Profile({required Key key, required this.onSignOut}) : super(key: key);

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

谢谢你,我非常爱你!祝你有美好的一天!!!!!哈哈,有一个伟大的自己和快乐的编码!请投赞成票^^