How to call method from another class in Flutter(Dart)?

后端 未结 3 1054
慢半拍i
慢半拍i 2020-12-28 19:47

I have created an Homepage and from that user can sign in for the app and in the next screen user can see their profile info(Only profile name) and under that their is signO

3条回答
  •  执念已碎
    2020-12-28 20:21

    you can create another logout() function and give context of home to push back to sign in screen/home screen , works for me as :

          logout() async {
            await googleSignIn.signOut();
            Navigator.push(context, MaterialPageRoute(builder: (context) => Home()));
          }
    

提交回复
热议问题