# flying-redux
**Repository Path**: gavinhome/flying-redux
## Basic Information
- **Project Name**: flying-redux
- **Description**: 组装式的 Flutter 应用程序框架。
- **Primary Language**: Dart
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 2
- **Forks**: 0
- **Created**: 2023-07-04
- **Last Updated**: 2024-01-04
## Categories & Tags
**Categories**: Uncategorized
**Tags**: Flutter, component, state-management, Redux, Framework
## README

[](https://pub.dev/packages/flying_redux)
[](https://github.com/GavinHome/flying-redux/actions/workflows/build.yml) [](https://codecov.io/gh/gvinhome/flying-redux)
[](https://pub.dev/packages/flying_redux/score)
[](https://pub.dev/packages/flying_redux/score)
[](https://pub.dev/packages/flying_redux/score)
[](https://github.com/GavinHome/flying-redux/tree/master/lib)
[](https://github.com/GavinHome/flying-redux/tree/master/lib)
## 简介
Flying Redux 是一个基于Redux状态管理的组装式flutter应用框架。

它有四个特性:
> 1. 函数式编程
> 2. 可预测的状态
> 3. 插拔式的组件化
> 4. 支持null safety 和 flutter 3.x
## 如何开始
以计数器为例,仅需要5步即可使用flying redux构建应用:
> 1. 引入 flying_redux
> 2. 创建状态类和初始化状态
> 3. 定义 Action 和 ActionCreator
> 4. 创建修改状态的 Reducer
> 5. 创建组件或页面视图以显示
```dart
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(