
Bloc State Management Library | Bloc
Official documentation for the bloc state management library. Support for Dart, Flutter, and AngularDart. Includes examples and tutorials.
Architecture - Bloc
Using the bloc library allows us to separate our application into three layers: Presentation; Business Logic; Data Repository; Data Provider; We’re going to start at the lowest level layer (farthest from the user interface) and work our way up to the presentation layer.
Flutter Bloc 核心概念
在本节中,我们将看一下 package:flutter_bloc 中包含的扩展方法以及它们的使用方式。 flutter_bloc 依赖于 package:provider,它简化了对 InheritedWidget 的使用。 在内部,package:flutter_bloc 使用 package:provider 实现了 BlocProvider、MultiBlocProvider、RepositoryProvider 和 MultiRepositoryProvider ...
Bloc 核心概念 | Bloc
相对于函数来说,Bloc 是一个依赖 事件 触发 状态 变更的更高级的类。Bloc 同样扩展了 BlocBase,这意味着它和 Cubit 一样拥有类似的公共 API,Blocs 不是调用 Bloc 上的 函数 并直接发出新的 状态,而是接收 事件 并将传入的 事件 转换为传出的 状态。
Bloc Concepts | Bloc
A Bloc is a more advanced class which relies on events to trigger state changes rather than functions. Bloc also extends BlocBase which means it has a similar public API as Cubit. However, rather than calling a function on a Bloc and directly emitting a new state, Blocs receive events and convert the incoming events into outgoing states.
Bloc State Management Library
Official documentation for the bloc state management library. Support for Dart, Flutter, and AngularDart. Includes examples and tutorials.
Flutter Login - Bloc
The HomePage can access the current user id via context.select((AuthenticationBloc bloc) => bloc.state.user.id) and displays it via a Text widget. In addition, when the logout button is tapped, an AuthenticationLogoutRequested event is added to the AuthenticationBloc.
Flutter Bloc Concepts
In this section, we’ll take a look at extension methods included in package:flutter_bloc and how they can be used. flutter_bloc has a dependency on package:provider which simplifies the use of InheritedWidget.
Flutter Counter - Bloc
BlocProvider, Flutter widget which provides a bloc to its children. BlocBuilder, Flutter widget that handles building the widget in response to new states. Using Cubit instead of Bloc. What’s the difference? Adding events with context.read.
Flutter Todos - Bloc
In the following tutorial, we’re going to build a todos app in Flutter using the Bloc library. Key Topics Bloc and Cubit to manage the various feature states.