Flutter • Firebase • BLoC Tutorial #8 - Authentication Screen

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ต.ค. 2024
  • Hello, in this Flutter & Firebase tutorial series, we'll build a complete app with a database (Firebase Firestore) and an authentication system (using Firebase auth).
    ------------------------------
    GitHub: github.com/rom...
    Subscribe !!

ความคิดเห็น • 13

  • @KwakuTabiriNow
    @KwakuTabiriNow 5 หลายเดือนก่อน

    Great Tutorial, a bit tough for beginners because of the copy pasta, but the flow is very very solid.
    Love it!

  • @vitor4456
    @vitor4456 ปีที่แล้ว +1

    Great tutorial! this series is helping me a lot.
    Im having an issue, when I register the user everything works fine on the sign up but the screen doesn't return to the homepage (when I restart the app it works), this just happens when I use routes, the blocBuilder return the login page when not logged and from the login page I navigate to the /register route.
    Like this:
    home: BlocBuilder(
    builder: (context, state) {
    if (state.status == AuthenticationStatus.authenticated) {
    return const Home();
    } else {
    return const LoginPage();
    }
    },
    ),
    routes: {
    // '/': (context) => const Home(),
    '/login': (context) => const LoginPage(),
    '/register': (context) => const RegisterPage(),
    },

    • @Romain_Girou
      @Romain_Girou  ปีที่แล้ว +1

      Hello !
      I will do a video on Routes because they are a bit special to understand at fitst. But basically here, you have a "home" parameter and in the "routes" parameter defined as well the "initial route" with " / ".
      So when you are doing the login, you need to navigate manualy to the Home page perhaps by using "popAndPush" or something like this.

    • @vitor4456
      @vitor4456 ปีที่แล้ว

      @@Romain_Girou Got it! thanks!
      A video on routes would be great

  • @fardinshaikh5496
    @fardinshaikh5496 7 หลายเดือนก่อน

    thanks Romain great tutorial, I have a doubt why are you using the setstate to update the bool value, can we update the state without setstate (using bloc )? If yes how can we do that, i guess using setstate in code multipal time is not a good programming practice and thank you once again :)

    • @Romain_Girou
      @Romain_Girou  7 หลายเดือนก่อน

      well it's not because you are using a state management system like bloc that you don't need setstate. If you have a bool value define in WidgetA and you need to change it's value you'll need to call setstate. even if you use bloc and the bloc state changes and you use a bloclistener to catch this state changes, you'll still need to call setstate to modify the UI if any modifications are neeeded.
      I hope I was clear, nothing can change on the UI without calling setstate

  • @Deezerme-x8i
    @Deezerme-x8i 7 หลายเดือนก่อน

    thank you very much for this content, I wish I could do a good job like you in future.
    just a question, is there better way than using setstate (stateful W in general)?

    • @Romain_Girou
      @Romain_Girou  6 หลายเดือนก่อน

      Thank you so much ☺️
      Stateful widgets should be use only when you need the widget to be dynamic meaning some data will need to update with set state otherwise it’s better to use stateless when possible

    • @Deezerme-x8i
      @Deezerme-x8i 6 หลายเดือนก่อน

      @@Romain_Girou i mean like using provider with bloc, is it better ?

  • @aouadicharaf1038
    @aouadicharaf1038 ปีที่แล้ว +1

    ❤❤❤

  • @chikezirimokoro250
    @chikezirimokoro250 7 หลายเดือนก่อน

    Great tutorial....The prefix icon doesn't appear on my screen until i tap on it.

    • @Romain_Girou
      @Romain_Girou  7 หลายเดือนก่อน

      Thank you !
      That's weird, perhaps a relaunch or some package are missing ?