我是新来的。
我正在将Google和Facebook登录集成到单个页面中。我已经在容器中设置了Google登录btn。请让我知道在哪里可以将具有登录注销条件的fb登录按钮放在同一容器中。这是我的代码。
Widget build(BuildContext context) {
// TODO: implement build
return MaterialApp(
home: Scaffold(
body: Container(
child: _isLoggedIn
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.network(_googleSignIn.currentUser.photoUrl, height: 50.0, width: 50.0,),
Text(_googleSignIn.currentUser.displayName),
OutlineButton( child: Text("Logout"), onPressed: (){
_logout();
},)
],
)
: Center(
child: OutlineButton(
child: Text("Login with Google"),
onPressed: () {
_login();
},
),
) ,
),
),
);
}
最佳答案
Center(
child: Row(
mainAxisAlignment:MainAxisAlignment.spaceEvenly,
children:[
OutlineButton(
child: Text("Login with Google"),
onPressed: () {
_login();
},
),
OutlineButton(
child: Text("Login with Facebook"),
onPressed: () {
//Todo
},
),
) ,
关于facebook - 将带有条件的Fb登录按钮放在容器中的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60483123/