Flutter • Firebase • BLoC Tutorial #8 - Authentication Screen

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 13

  • @KwakuTabiriNow
    @KwakuTabiriNow 4 месяца назад

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

  • @aouadicharaf1038
    @aouadicharaf1038 11 месяцев назад +1

    ❤❤❤

  • @vitor4456
    @vitor4456 10 месяцев назад +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  10 месяцев назад +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 10 месяцев назад

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

  • @fardinshaikh5496
    @fardinshaikh5496 6 месяцев назад

    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  5 месяцев назад

      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

  • @chikezirimokoro250
    @chikezirimokoro250 6 месяцев назад

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

    • @Romain_Girou
      @Romain_Girou  6 месяцев назад

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

  • @user-jh5os3ys4b
    @user-jh5os3ys4b 5 месяцев назад

    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  5 месяцев назад

      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

    • @user-jh5os3ys4b
      @user-jh5os3ys4b 5 месяцев назад

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