相关阅读
(资料图片仅供参考)
Flying Redux 是一个基于Redux状态管理的组装式flutter应用框架。
它有四个特性:
函数式编程可预测的状态插拔式的组件化支持null safety 和 flutter 3.x如何开始
以计数器为例,仅需要5步即可使用flying redux构建应用:
引入 flying_redux创建状态类和初始化状态定义 Action 和 ActionCreator创建修改状态的 Reducer创建组件或页面视图以显示
import "package:flying_redux/flying_redux.dart";/// [State]class PageState extends Cloneable { late int count; @override PageState clone() { return PageState()..count = count; }}/// [InitState]PageState initState(Map? args) { //just do something here... return PageState()..count = 0;}/// [Action]enum CounterAction { increment }/// [ActionCreator]class CounterActionCreator { static Action increment() { return const Action(CounterAction.increment, payload: 1); }}/// [Reducer]buildReducer() { return asReducer(
待办示例如果你需要一个完整的使用例子,请参考 /example
文件夹中的 todo-list 示例。
cd ./exampleflutter run
模板插件(未上架,进行中)Flying Redux Template For VSCode.Flying Redux Template For AndroidStudio.感谢实际上,flying-redux的源码在命名和实现上与fish-redux基本类似,但是fish-redux太长时间不更新了,基于它做了大量重构和修改,精简了很多概念,最后重新命名了它。
本文首次发表于掘金专栏文章
关键词:
上一篇: 居住证到期后续期需要什么资料,居住证有效期多长时间
下一篇: 最后一页
相关阅读
2023-07-30
2023-07-30
2023-07-30
2023-07-30
2023-07-30
2023-07-30
2023-07-30
2023-07-30
2023-07-30
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-29
2023-07-28
2023-07-28
2023-07-28
2021-12-02
2021-12-02
2021-12-02
2021-12-02