Skip to content

Software Development at Program Tom LTD

Place for coding, programming, development and software in general.

Menu
  • Blog
  • PDF Booklets
  • Dev Utils & Content
  • Java Spring Boot Or Web Apps
  • English
    • български
    • English
    • Español
    • Português
    • हिन्दी
    • Русский
    • Deutsch
    • Français
    • Italiano
    • العربية
  • About Us
  • Flutter Apps
Menu
What are the Flutter BloC State Management - Common States

What are the Flutter BloC State Management – Common States

Posted on July 12, 2023July 12, 2023 by Toma Velev

In the BLoC (Business Logic Component) state management pattern of Flutter Framework, there are typically few common states used to represent the different stages of data or UI changes.

Loading State

The loading state is used to indicate that the application or a specific feature is currently fetching data from an external source, such as an API or a database. This state is often displayed with a loading indicator or a progress bar to inform the user about the ongoing operation.

In Progress State

In progress state could be a loading state, but it could be transition between states of already loaded content. This state is implemented with different type of animations.

Another type that is in the middle is – when there are already loaded items and more content is in progress. In this case Loading with Tag (usually a string) is used. 

Error State

An error state can be used to handle scenarios where an API call fails or an exception occurs. The error state can provide relevant error information to the user and allow for appropriate error handling.

Data/Content State

The data or content state represents the successful retrieval of data and its availability for presentation or manipulation. This state typically holds the fetched data and is responsible for rendering the appropriate UI components to display the content to the user. For example, it could be used to show a list of items fetched from an API.

Empty State

Many UIs have special UI for the case when

  • the loading has finished
  • there are no records in the database yet. 

Initial State

The initial state represents the starting point of the application or a specific feature before any user interaction or data loading occurs. It usually indicates that the feature is in a neutral or idle state, waiting for user input or data to be fetched.

These states, provide a basic structure that is commonly used in Flutter applications leveraging the BLoC pattern. This enforces good practices and designs and makes you think about the else cases. I am offering you to continue reading – Why you need state management in Flutter.

  • Example of GridView Builder in Flutter
  • How to Visualize Listview inside Listview in Flutter
  • What other usages you know about public private cryptography
  • Get a Flutter App to Production
  • Firebase Dynamic Links Deprecation – migrating out to Java

Categories

  • Apps (20)
  • ChatGPT (19)
  • Choosing a Framework (38)
  • Flutter (201)
  • Graphical User Interface (13)
  • Marketing (113)
  • Software Development (268)
  • Spring (41)
  • StartUp (21)
  • Uncategorized (15)
  • Uncategorized (4)
  • Vaadin (14)

Tags

Algorithms (9) crypto (29) flutterdev (39) General (86) Java (7) QR & Bar Codes (3) Software Dev Choices (33) Spring Boot (1) standards (1) Theme (3) User Authentication & Authorization (9) User Experience (10) Utilities (19) WordPress (11)

Product categories

  • All Technologies (83)
    • Flutter Apps (23)
    • GPT (4)
    • Java (38)
    • Native Android (3)
    • PHP (9)
    • Spring (Boot) / Quarkus (35)
    • Utils (15)
    • Vaadin 24+ (27)
    • Vaadin 8 (1)
  • Apps (18)
    • Employees DB (1)
    • Notes (6)
    • Personal Budget (1)
    • Recipes Book (1)
    • Stuff Organizer (1)
    • To-Do (2)
  • PDF Books (3)
  • Source Code Generators (8)

Recent Posts

  • Example of GridView Builder in Flutter
  • How to Visualize Listview inside Listview in Flutter
  • What other usages you know about public private cryptography
  • Get a Flutter App to Production
  • Firebase Dynamic Links Deprecation – migrating out to Java

Post Categories

  • Apps (20)
  • ChatGPT (19)
  • Choosing a Framework (38)
  • Flutter (201)
  • Graphical User Interface (13)
  • Marketing (113)
  • Software Development (268)
  • Spring (41)
  • StartUp (21)
  • Uncategorized (15)
  • Uncategorized (4)
  • Vaadin (14)