London Escorts sunderland escorts 1v1.lol unblocked yohoho 76 https://www.symbaloo.com/mix/yohoho?lang=EN yohoho https://www.symbaloo.com/mix/agariounblockedpvp https://yohoho-io.app/ https://www.symbaloo.com/mix/agariounblockedschool1?lang=EN
6.9 C
New York
Saturday, February 1, 2025

android – StreamBuilder userLogin Display not working


I’m making a easy login web page the place after a consumer indicators in as a visitor, they’re redirected to the Dashboard. However for some motive, the Dashboard display screen would not appear to load when the consumer logs in as a visitor instantly, however solely reveals up when i sizzling restart the app.

That is the Login Display

class Screen4 extends StatelessWidget {
  const Screen4({
    tremendous.key,
  });

  @override
  Widget construct(BuildContext context) {
    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 15),
      width: double.infinity,
      top: double.infinity,
      youngster: Stack(
        youngsters: [
          Positioned(
            top: 20,
            child: Container(
              padding: const EdgeInsets.all(30),
              decoration: BoxDecoration(
                color: Colors.teal,
                borderRadius: BorderRadius.circular(20),
              ),
              child: Column(
                children: [
                  Text(
                    'Create a',
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 40,
                      fontFamily: GoogleFonts.oswald().fontFamily,
                      height: 1,
                      fontWeight: FontWeight.w700,
                    ),
                  ),
                  Text(
                    'Job-Ready',
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 40,
                      fontFamily: GoogleFonts.oswald().fontFamily,
                      height: 1,
                      fontWeight: FontWeight.w700,
                    ),
                  ),
                  Text(
                    'Resume ',
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 40,
                      fontFamily: GoogleFonts.oswald().fontFamily,
                      height: 1,
                      fontWeight: FontWeight.w700,
                    ),
                  ),
                  Text(
                    'in Minutes.',
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 40,
                      fontFamily: GoogleFonts.oswald().fontFamily,
                      height: 1,
                      fontWeight: FontWeight.w700,
                    ),
                  ),
                ],
              ),
            ),
          ),
          Positioned(
            backside: 220,
            proper: 0,
            youngster: Container(
              padding: const EdgeInsets.all(30),
              ornament: BoxDecoration(
                colour: Colours.amber.shade800,
                borderRadius: BorderRadius.round(20),
              ),
              youngster: Column(
                youngsters: [
                  Text(
                    '3 Steps.',
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 40,
                      fontFamily: GoogleFonts.oswald().fontFamily,
                      height: 1,
                      fontWeight: FontWeight.w700,
                    ),
                  ),
                  Text(
                    '5 Minutes.',
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 40,
                      fontFamily: GoogleFonts.oswald().fontFamily,
                      height: 1,
                      fontWeight: FontWeight.w700,
                    ),
                  ),
                ],
              ),
            ),
          ),
          Positioned(
            width: MediaQuery.of(context).dimension.width - 30,
            backside: 20,
            youngster: Column(
              youngsters: [
                InkWell(
                  onTap: () async {
                    await AuthService().googleSignIn();
                  },
                  child: Container(
                    height: 70,
                    decoration: const BoxDecoration(
                      color: Colors.white,
                    ),
                    child: Padding(
                      padding: const EdgeInsets.all(10),
                      child: Stack(
                        children: [
                          const Align(
                            alignment: Alignment.centerLeft,
                            child: Icon(
                              FontAwesomeIcons.google,
                              color: Colors.black,
                            ),
                          ),
                          Align(
                            alignment: Alignment.center,
                            child: Text(
                              'Continue with Google',
                              style: TextStyle(
                                color: Colors.black,
                                fontSize: 25,
                                fontFamily: GoogleFonts.oswald().fontFamily,
                                height: 1,
                                fontWeight: FontWeight.w200,
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                ),
                const SizedBox(
                  top: 20,
                ),
                InkWell(
                  onTap: () async {
                    await AuthService().signInAnon();
                  },
                  youngster: Container(
                    top: 70,
                    ornament: const BoxDecoration(
                      colour: Colours.white,
                    ),
                    youngster: Padding(
                      padding: const EdgeInsets.all(10),
                      youngster: Stack(
                        youngsters: [
                          const Align(
                            alignment: Alignment.centerLeft,
                            child: Icon(
                              FontAwesomeIcons.user,
                              color: Colors.black,
                            ),
                          ),
                          Align(
                            alignment: Alignment.center,
                            child: Text(
                              'Continue as Guest',
                              style: TextStyle(
                                color: Colors.black,
                                fontSize: 25,
                                fontFamily: GoogleFonts.oswald().fontFamily,
                                height: 1,
                                fontWeight: FontWeight.w200,
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}

That is the Onboarding Display


  const OnboardingScreen({tremendous.key});

  @override
  State<OnboardingScreen> createState() => _OnboardingScreenState();
}

class _OnboardingScreenState extends State<OnboardingScreen> with TickerProviderStateMixin {
  late remaining AnimationController cont = AnimationController(
    vsync: this,
    period: const Length(microseconds: 200),
  );

  late remaining AnimationController cont1 = AnimationController(
    vsync: this,
    period: const Length(seconds: 3),
  );

  late remaining Animation anim = Tween<double>(start: 220, finish: 200).animate(CurvedAnimation(
    father or mother: cont,
    curve: Curves.bounceInOut,
  ));

  late remaining Animation ganim = Tween<double>(start: 0.4, finish: 0).animate(
    CurvedAnimation(father or mother: cont1, curve: Curves.easeInOut),
  );

  @override
  void initState() {
    tremendous.initState();

    cont1.repeat(reverse: true);
  }

  @override
  void dispose() {
    cont.dispose();
    cont1.dispose();

    tremendous.dispose();
  }

  @override
  Widget construct(BuildContext context) {
    return Scaffold(
      physique: AnimatedBuilder(
        animation: ganim,
        builder: (context, youngster) {
          return Container(
            ornament: BoxDecoration(
              gradient: LinearGradient(
                colours: [Colors.pink.shade100, Colors.pink.shade200],
                start: Alignment.topCenter,
                finish: Alignment.bottomRight,
                stops: [0.1 + ganim.value, (0.3 + ganim.value).toDouble()],
              ),
            ),
            width: MediaQuery.of(context).dimension.width,
            top: MediaQuery.of(context).dimension.top,
            youngster: Remodel.translate(
              offset: const Offset(-15, 20),
              youngster: Heart(
                youngster: SizedBox(
                  width: 300,
                  top: 400,
                  youngster: Column(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.begin,
                    youngsters: [
                      SizedBox(
                        child: Text(
                          'RESUME nCRAFT',
                          style: TextStyle(
                            fontFamily: GoogleFonts.oswald().fontFamily,
                            fontSize: 50,
                            height: 1,
                            fontWeight: FontWeight.bold,
                            color: Colors.black,
                          ),
                        ),
                      ),
                      SizedBox(
                        child: Text(
                          'Your Resume Redefined',
                          style: TextStyle(
                            fontFamily: GoogleFonts.oswald().fontFamily,
                            fontSize: 30,
                            height: 1,
                            fontWeight: FontWeight.bold,
                            color: Colors.black,
                          ),
                        ),
                      ),
                      SizedBox(
                        child: Text(
                          'Welcome to ResumeCraft, where we redefine resume creation. Craft a modern and compelling resume that sets you apart from the competition. Your journey to success begins with a simple tap. Let us get started on your redefined resume.',
                          style: TextStyle(
                            fontSize: 16,
                            color: Colors.black.withOpacity(0.7),
                          ),
                        ),
                      ),
                      AnimatedBuilder(
                        animation: anim,
                        builder: (context, child) {
                          return Container(
                            width: anim.value,
                            decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(20),
                              border: Border.all(color: Colors.black, width: 3),
                              color: Colors.white,
                            ),
                            padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 5),
                            child: ElevatedButton(
                              onPressed: () {
                                cont.forward();
                                Future.delayed(
                                  const Duration(milliseconds: 200),
                                  () {
                                    cont.reverse();
                                  },
                                );

                                Future.delayed(
                                  const Duration(milliseconds: 500),
                                  () {
                                    Navigator.of(context).push(
                                      MaterialPageRoute(
                                        builder: (context) => const LoaderScreen(),
                                      ),
                                    );
                                  },
                                );

                                Future.delayed(
                                  const Duration(milliseconds: 4500),
                                  () {
                                    Navigator.of(context).push(
                                      PageRouteBuilder(
                                        pageBuilder: (context, animation, secondaryAnimation) {
                                          return const LoginScreen();
                                        },
                                        transitionsBuilder: (context, animation, secondaryAnimation, child) {
                                          final canim = CurvedAnimation(parent: animation, curve: Curves.easeInOutCirc);

                                          return ScaleTransition(
                                            scale: canim,
                                            alignment: Alignment.center,
                                            child: child,
                                          );
                                        },
                                      ),
                                    );
                                  },
                                );
                              },
                              style: ElevatedButton.styleFrom(
                                backgroundColor: Colors.transparent,
                                shadowColor: Colors.transparent,
                              ),
                              child: const Text(
                                'Get Started',
                                style: TextStyle(fontSize: 20, color: Colors.black, fontWeight: FontWeight.bold),
                              ),
                            ),
                          );
                        },
                      )
                    ],
                  ),
                ),
              ),
            ),
          );
        },
      ),
    );
  }
}

That is the DashBoard Display

class DashScreen extends StatefulWidget {
  const DashScreen({tremendous.key});

  @override
  State<DashScreen> createState() => _DashScreenState();
}

class _DashScreenState extends State<DashScreen> {
  @override
  Widget construct(BuildContext context) {
    return Scaffold(
      appBar: Appbar(
        main: IconButton(
          icon: const Icon(
            FontAwesomeIcons.powerOff,
            colour: Colours.white,
          ),
          onPressed: () {
            AuthService().signOut();
          },
        ),
        title: const Textual content(''),
      ),
      physique: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 20),
        youngster: ListView(
          youngsters: [
            const SizedBox(
              height: 10,
            ),
            SizedBox(
              width: MediaQuery.of(context).size.width,
              child: Column(
                children: [
                  Text(
                    'Get Inspired by Resume Samples from Various Industires',
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 50,
                      fontFamily: GoogleFonts.oswald().fontFamily,
                      height: 1,
                      fontWeight: FontWeight.w700,
                    ),
                    textAlign: TextAlign.center,
                  ),
                  const SizedBox(
                    height: 15,
                  ),

This is the decider Logic

class DeciderScreen extends StatelessWidget {
  const DeciderScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return StreamBuilder(
        stream: AuthService().duser,
        builder: (context, snapshot) {
          if (snapshot.connectionState == ConnectionState.waiting) {
            return const LoaderScreen();
          } else if (snapshot.connectionState == ConnectionState.active) {
            if (snapshot.hasError) {
              return const Center(child: Text('Error'));
            } else if (snapshot.hasData) {
              print(snapshot.data);
              return const DashScreen();
            } else {
              return const OnboardingScreen();
            }
          } else {
            return const Center(child: Text('Error'));
          }
        });
  }
}

For some reason, when i mention LoginScreen instead of OnboardingScreen in the else logic, the Dashboard shows up. Only when I write OnboardingScreen, the Dashboard has issues showing up.

Any help would be much appreciated.
Thank You.

Related Articles

Social Media Auto Publish Powered By : XYZScripts.com