Caching data with BLOC & HIVE in FLUTTER, Caching API Data Using HIVE DataBase, Flutter Offline Mode

Поділитися
Вставка
  • Опубліковано 31 лип 2024
  • This tutorial explores caching API call data in Flutter using BLOC and Hive. It follows a three-tier architecture with a service locator for easy access to class instances. Along the way, it covers error handling, interface class creation, and more. Stick around till the end for a comprehensive learning experience!
    🔹 Topic Covered:
    1️⃣ Three-tier architecture
    2️⃣ Repository Pattern
    3️⃣ Structured and Type-Safe Error Handling
    4️⃣ Working with different data sources (local and remote)
    5️⃣ Working with Bloc classes
    6️⃣ Interface Classes
    7️⃣ Service locator with Get_it (dependency injection)
    8️⃣ Required Helpers, Utilities, Extensions, etc.
    9️⃣ API Calling
    🔟 Creating a Hive Model Object
    1️⃣1️⃣ Create, read, and update operations for the database
    1️⃣2️⃣ Bloc widgets, BLOCProvider, BlocConsumer, BlocListener, etc.
    1️⃣3️⃣ Working with Database Services
    1️⃣4️⃣ Connection checker
    1️⃣5️⃣ Custom Alerts, Custom Image Viewer, and Custom Loading Widget
    1️⃣6️⃣ Pull-to-Refresh Feature
    1️⃣7️⃣ Designing a Transparent, Sleek, and Modern Bottom Navigation Bar
    And much more...
    📌 Get the Source Code:
    ➡️ github.com/AmirBayat0/Flutter...
    ⚡ Subscribe for more content:
    ProgrammingWithFlexz: ‪@ProgrammingWithFlexZ‬
    📱 Discover a wealth of Flutter resources!
    My GitHub 👉👉 github.com/AmirBayat0/
    My Instagram 👉👉 / codewithflexz
    More social media 👉👉 zaap.bio/CodeWithFlexz
    💖 Grateful for Your Support!
    Your encouragement fuels my journey! Remember to like and subscribe for fresh content. Let's code, learn, and thrive together! 🧡
    If you find it valuable and wish to endorse my work, why not treat me to a coffee? ☕️ Your support truly fuels my endeavors!
    👉👉 Click here: www.buymeacoffee.com/amirbayat
    🔊 License:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Music provided by TheRelaxedMovement.
    Check it out here: / @therelaxedmovement
    © Henry Keate t/a TheRelaxedMovement. All Rights Reserved
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #flutter #flutterdev #bloc #hive #offlinemode #fluttercaching #flutterdatabase #mobiledev #appdevelopment #dart #blocpattern #getx #dependencyinjection #api #customwidgets #uiux #navigationbar
    📚 Chapters:
    ⌨️ (00:00:00) Let's Get Started: Project Introduction
    ⌨️ (00:01:26) Displaying Previously Utilized Packages for the Project
    ⌨️ (00:01:47) Establishing the Configuration Folder and Crafting Corresponding Files (API Endpoints, App Themes)
    ⌨️ (00:03:00) Creating the Core Folder: Centralizing Common Files for the Entire Project (Helpers, Utilities, Extensions, etc.)
    ⌨️ (00:03:04) Setting Up the Feature Folder
    ⌨️ (00:03:08) Structuring the Home Feature (Data Sources, Models, Presentation Layers - View, Bloc, Widgets, Repository)
    ⌨️ (00:03:23) Initiating Home Page Development
    ⌨️ (00:04:04) Implementing Data Folder to Store Product Hive Model, Home Local and Remote Source API Providers, and Database Services
    ⌨️ (00:04:08) Defining Product Model and Converting it to Hive Object
    ⌨️ (00:06:40) Building Home Remote Data Source (API Provider)
    ⌨️ (00:08:43) Creating Home DataState Dart File for Structured and Type-Safe Error Handling
    ⌨️ (00:09:20) Crafting Interface Class for Implementing Repository and Service Classes
    ⌨️ (00:09:48) Establishing Home Local Data Source (Database Service)
    ⌨️ (00:12:37) Developing Home Local Data Source (Database Provider)
    ⌨️ (00:13:30) Designing Connection Helper Class for Connection Checking
    ⌨️ (00:14:15) THE CRUCIAL SEGMENT OF THE TUTORIAL: Creating a Home Repository to Determine Data Fetching from Local or Remote Sources
    ⌨️ (00:18:23) Integrating 'get_it' for Dependency Injection and Service Location in our Project
    ⌨️ (00:21:15) Formulating Bloc: Home Bloc, Home State, Home Status, and Home Event Classes to Incorporate Repository and Transmit Fetched Data to UI
    ⌨️ (00:21:26) Developing Home Event Class
    ⌨️ (00:22:30) Developing Home Status Class
    ⌨️ (00:22:47) Developing Home State Class
    ⌨️ (00:23:35) Crafting Home Bloc Class
    ⌨️ (00:26:10) Instantiating Bloc and Registering it in the Service Locator
    ⌨️ (00:26:35) Providing Previously Created Bloc using BlOCPROIVDER
    ⌨️ (00:27:01) Organizing Utils Folder: Custom Alerts, Custom Image Viewer, and Custom Loading Widget
    ⌨️ (00:27:01) Designing User Interface - Home Page - and Integrating Required Bloc Widgets for Checking Different States and Displaying Respective Widgets
    ⌨️ (00:31:53) Adding Pull-to-Refresh Feature on Home Page
    ⌨️ (00:32:27) Testing the Developed Features up to This Point
    ⌨️ (00:33:42) Notifying Users about Data Sources with Top-Side Alerts Using Listener in Bloc Consumer
    ⌨️ (00:34:55) Creating Error Screen for Instances with No Cached Data
    ⌨️ (00:36:28) Designing Transparent, Sleek, and Modern Bottom Navigation Bar
    ⌨️ (00:37:27) PROJECT COMPLETED - FINAL REVIEW AND TESTING
    ⌨️ (00:39:01) 🚀✨ Don't Miss Out! SUBSCRIBE NOW! 🔔👇 #JoinUs
  • Наука та технологія

КОМЕНТАРІ • 21

  • @ProgrammingWithFlexZ
    @ProgrammingWithFlexZ  3 місяці тому +2

    Hello everyone! 😊 Please support us by #subscribing, #commenting, #liking, and #sharing the content! 🙌 Thank you! 🌟

  • @0bserver0ne
    @0bserver0ne 3 місяці тому +3

    Excellent video, a similar video would be good, explaining the process of saving a form offline and then synchronizing that item when connecting to the internet.

    • @ProgrammingWithFlexZ
      @ProgrammingWithFlexZ  3 місяці тому +1

      Thank you so much for the feedback! 🙏 It means the world to me! 🌍 And double thanks for your idea for the next content. 🚀 I'll definitely work on it for future videos. 📹 Much appreciated! 😊

  • @safegame1751
    @safegame1751 3 місяці тому +3

    Fantastic video brother, It was super helpful for me, integrating get_it for dependency infection with repository patterns was the new topic that I completely understood and learned from your video, Thanks a lot for taking time to create great videos for your subscribers.🙏🌹

    • @ProgrammingWithFlexZ
      @ProgrammingWithFlexZ  3 місяці тому

      Wow, thank you so much for your kind words! 😊 I'm thrilled to hear that the video was helpful for you, It's fantastic to know that you learned something new from it! 🚀 Your support and appreciation mean a lot to me, and I'm grateful for your encouragement. If you ever have any questions or need further assistance, feel free to reach out anytime! 🌟🙏

  • @sametdikmen
    @sametdikmen 3 місяці тому +3

    thank you, nice video

    • @ProgrammingWithFlexZ
      @ProgrammingWithFlexZ  3 місяці тому

      You're very welcome! I'm glad you enjoyed the video. If you have any questions or want to share more thoughts, feel free to let me know! 😊❤️

    • @sametdikmen
      @sametdikmen 3 місяці тому +1

      I would be very happy if a more comprehensive e-commerce project comes up with bloc, thank you again ❤️😊

    • @ProgrammingWithFlexZ
      @ProgrammingWithFlexZ  3 місяці тому

      Your suggestion for upcoming courses is incredibly on point! 🚀 I'll definitely put effort into developing similar content for my future videos. Much appreciated! 🙌

    • @sametdikmen
      @sametdikmen 3 місяці тому

      @@ProgrammingWithFlexZ Great ! 🤝🏼

  • @mahdimax8224
    @mahdimax8224 3 місяці тому

    I found it very useful for flutter developers and it is recommended to watch it a couple of times to understand it better 🎉

    • @ProgrammingWithFlexZ
      @ProgrammingWithFlexZ  3 місяці тому

      Thank you for your feedback! I'm glad you found the content useful🌱

  • @Amankumar_Raone
    @Amankumar_Raone 3 місяці тому +2

    which extension did you use to convert model to hive??

  • @abdalwahaborabi9765
    @abdalwahaborabi9765 Місяць тому

    hi i tried your app but it shows no network connection always

    • @ProgrammingWithFlexZ
      @ProgrammingWithFlexZ  Місяць тому

      Hi! Thanks for your comment. 😊 are you following the tutorial steps exactly?

    • @abdalwahaborabi9765
      @abdalwahaborabi9765 Місяць тому +1

      @@ProgrammingWithFlexZ thanks it seemes i removed somthing it worked perfect

    • @ProgrammingWithFlexZ
      @ProgrammingWithFlexZ  Місяць тому

      You're welcome! I'm so glad to hear it worked perfectly for you! If you need any more help or have any other questions, feel free to reach out. Have a great day! 😊