build method

  1. @override
Widget build(
  1. BuildContext context
)
override

The build method for constructing the UI of the Navigation widget.

Implementation

@override
Widget build(BuildContext context) {
  return Scaffold(
    resizeToAvoidBottomInset: false,
    body: StreamBuilder<User?>(
      stream: FirebaseAuth.instance.authStateChanges(),
      builder: (BuildContext context, AsyncSnapshot snapshot) {
        if (snapshot.hasError) {
          return const Center(child: CircularProgressIndicator());
        }
        if (snapshot.connectionState == ConnectionState.waiting) {
          return const Center(
            child: Text("Something went Wrong !!"),
          );
        } else if (snapshot.hasData) {
          var user = FirebaseAuth.instance.currentUser;
          return const PlayGame();
        } else {
          return const PlayGame();
        }
      },
    ),
  );
}