BLoC Navigation with Flutter | Day 15

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • Kilo Loco shows you how to navigate between screens using Flutter BLoC and the Navigator 2.0. This tutorial will cover creating a navigation cubit, implementing a MultiBlocProvider, and utilizing the cubit's state to determine when to show a post details screen.
    ** Show Notes and Links **
    Project Files:
    github.com/Kil...
    Kilo Loco on Social Media:
    www.kiloloco.com
    Discord - / discord
    Twitter - / kilo_loco
    Instagram - / kilo_loco
    #flutter #dartlang #30DaysOfFlutter

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

  • @diegotrujillo6284
    @diegotrujillo6284 3 года назад

    Yeahhh bro, this series are killing me!!! lmL KILO LOCOUUU

    • @komalastawala1459
      @komalastawala1459 3 года назад

      Hello i'm havibg an error while using AppNavigator() in main.dart file
      Child: AppNavigator(),
      It shows 1positional argument(s) expected but 0 found

  • @ezone2726
    @ezone2726 3 года назад +1

    Bloc series is 🔥
    #thankyou #flutter #happycoding
    #sharemoretutorial

    • @Kilo_Loco
      @Kilo_Loco  3 года назад +4

      Thanks! It seems to be the more popular pattern at the moment so almost everything from here on out will be using BLoC

    • @ezone2726
      @ezone2726 3 года назад

      @@Kilo_Loco yes it is!
      And thank you so much❤️

  • @faizulla5838
    @faizulla5838 2 года назад

    Good!
    And Thank's for English class for me "a 'Ffff__n ' like that so easy peasy - lemon squeezy " , will on Monday I will use it on meting, expats will have a shock )))

  • @fluttercoder1814
    @fluttercoder1814 3 года назад

    Thanks for this amazing series Kilo...simply amazing.

  • @handsanitizer2457
    @handsanitizer2457 3 года назад

    Kilo thanks brother

  • @JBridgeTube
    @JBridgeTube Год назад +1

    kilo
    do you have a video for the new version of the bloc (version 8)? You explained it as easy to understand...
    thank you

  • @jaayaustin336
    @jaayaustin336 3 года назад

    you rock my dude!

  • @VibhanshuChawla
    @VibhanshuChawla 11 месяцев назад

    2023 and I am referring his videos over and over again to learn basics 🤌🤌

  • @tranminhhaifet
    @tranminhhaifet 3 года назад +2

    Thanks a lot! this helps me quickly able to use cubit&block, 10x more productive than reading api docs. feel that cubit&bloc somehow similar to observerable in swifuit, isn't it?

    • @Kilo_Loco
      @Kilo_Loco  3 года назад

      There are definitely a lot of similarities. I’ll be doing a bloc pattern tutorial in swift sometime after the challenge

    • @tranminhhaifet
      @tranminhhaifet 3 года назад

      @@Kilo_Loco can we use onTap: () => Navigator.puh(goto PostDetailView()) ? for each Card? pages inside Navigator can access the Cubit, many thanks your video ( I was struggling this).

    • @drankou
      @drankou 3 года назад

      @@Kilo_Loco I feel like Swift enums with the associated value could really shine there :)

  • @creativetech8471
    @creativetech8471 3 года назад

    you should start using bloc extension or flutter snippets

  • @feruzbekabdurahimov3122
    @feruzbekabdurahimov3122 3 года назад +1

    Hello everyone I am learning flutter and new this sphere. I have an error. class NavCubit extends Cubit {
    NavCubit() : super(null); this ''null'' is making eror
    void showPostDetails(Post post) => emit(post);
    void popToPosts() => emit(null);
    }
    how can I fix it? could you help me? please.

    • @minhhieuvodoan1897
      @minhhieuvodoan1897 3 года назад +4

      I think you should change NavCubit extends Cubit to NavCubit extends Cubit

    • @Praveenmgupta
      @Praveenmgupta 3 года назад

      Hi, If we put Cubit
      then the following code gives an error
      class AppNavigator extends StatelessWidget {
      const AppNavigator({Key? key}) : super(key: key);
      @override
      Widget build(BuildContext context) {
      return BlocBuilder( //this

    • @kanyevest
      @kanyevest 3 года назад +1

      @@Praveenmgupta there's that line that has . Change that to to indicate that the post can be null

  • @isheraz
    @isheraz 3 года назад

    Hey Pressing back button exits the app, can you tell what it could possibly be?

  • @bbalachandhar
    @bbalachandhar 2 года назад

    how do we add a drawer menu and login screen with this example?

  • @jai6133
    @jai6133 3 года назад

    How can we do parallel api calls in flutter bloc ?

  • @deepjyotibaishya7576
    @deepjyotibaishya7576 3 года назад

    how to use two bloc and manage one single state

  • @argahutama
    @argahutama 3 года назад

    I prefer Getx in navigation

  • @Praveenmgupta
    @Praveenmgupta 3 года назад

    Hi, I am getting an error, please help-
    class AppNavigator extends StatelessWidget {
    const AppNavigator({Key? key}) : super(key: key);
    @override
    Widget build(BuildContext context) {
    return BlocBuilder( //this

  • @adriankadusza8342
    @adriankadusza8342 2 года назад +1

    With Bloc v8.0.0. mapEventToState is deprecated so, here You go, i did it ...
    class PostsBloc extends Bloc {
    final _dataService = DataService();
    PostsBloc() : super(LoadingPostsState()) {
    on((event, emit) async {
    await _getPost(emit);
    });
    }
    Future _getPost(Emitter emit) async {
    emit(LoadingPostsState());
    try {
    final posts = await _dataService.getPosts();
    emit(LoadedPostsState(posts: posts));
    } on Error catch (e) {
    emit(FailedToLoadPostsState(error: e));
    }
    }
    }