Flutter学习笔记
Flutter学习——Bloc(业务逻辑组件)篇
1、 简单介绍
-
安装
-
优点
-
核心概念
1. bloc (1)Events(事件):Bloc的输入,通常用于用户交互(例如:按钮点击事件、页面加载事件等) (2)States(状态):Bloc的输出,一般指的是应用某部分的数据模块,应用的状态改变会驱动视图更新 (3)Transitions(状态转换/过渡?):应用中的某个模块的数据(状态)转换, ==A Transition consists of the current state, the event, and the next state== (4)Streams(流):流指的是一系列的异步数据(异步数据流), ==A stream is a sequence of asynchronous data== (5)Blocs(Business Logic Component):将输入的事件流转化为输出的状态流, ==converts a Stream of incoming Events into a Stream of outgoing States== (6)BlocDelegate 2.flutter_bloc