alibaba / fish-redux Goto Github PK
View Code? Open in Web Editor NEWAn assembled flutter application framework.
Home Page: https://github.com/alibaba/fish-redux
License: Apache License 2.0
An assembled flutter application framework.
Home Page: https://github.com/alibaba/fish-redux
License: Apache License 2.0
我们不在关系组装过程=>我们不在关心组装过程
喜欢 flutter ,先支持一下
能否给下具体使用文档
比如说登录成功后,需要把用户信息共享在多个界面访问,能访问全局app的配置吗?类似store.of(context)
mark一波再看
比如pool代表什么意思?
ToDoListAdapter是怎么把_ToDoListConnector的数据传递到pool里面的?
adapter关联的是一个list类型的connector不应该builder出一个ListView么?为什么通过adapter.itemBuilder出了一个item?
还有那三个Aapter分别用在什么场合?
Compiler message:
lib/todo_edit_page/view.dart:69:23: Error: Duplicated named argument 'backgroundCursorColor'.
backgroundCursorColor: const Color(0xFFFFF59D)
^^^^^^^^^^^^^^^^^^^^^
Compiler failed on /Users/tangfh/develop/workspace/flutter/fish-redux/sample/lib/main.dart
跟 flutter_redux 一样的还是有什么改进吗?
Component的设计很棒,但是Page类是Component的继承,最终是基于一个StatefulWidget,不太适合作为根布局,不知道有什么更好的设计方式?
记得之前在公众号上看到过会有插件支持?生成一部分样板代码。
源码的注释有点少 太简单 关于Connector和Adapter的特有概念说明文档太少 例子中很少有注释
使用OOP方式编写view的时候,发现有闭包的问题,请问怎么处理?
下面这段代码来自官方sample例子的简单修改:
class TodoView extends ViewPart<ToDoState>{
@override
Widget build() {
return _build();
}
Widget _build() {
return Container(
padding: const EdgeInsets.all(8.0),
child: GestureDetector(
child: Column(
children: <Widget>[
GestureDetector(
child: Container(
height: 36.0,
color: state.isDone ? Colors.green : Colors.red,
child: Row(
children: <Widget>[
Container(
child: const Icon(Icons.label_outline),
margin: const EdgeInsets.all(8.0),
),
Expanded(
child: Text(
state.title ?? '',
maxLines: 1,
style: const TextStyle(color: Colors.white, fontSize: 18.0),
)),
GestureDetector(
child: Container(
margin: const EdgeInsets.only(right: 16.0),
child: (() => state.isDone
? const Icon(Icons.check_box)
: const Icon(Icons.check_box_outline_blank))(),
),
onTap: () {
print(state.uniqueId);
/////////这里存在闭包的问题
dispatch(ToDoActionCreator.doneAction(state.uniqueId));
},
)
],
),
alignment: AlignmentDirectional.centerStart,
//省略下面代码........
一个 组件的 Reducer 由 Component 自身配置的 Reducer 和它的 Dependencies 下的所有子 Reducers 自动复合而成。
我看文档里提到上面这句话,但是我做了个简单的试验没有成功,请问这有什么需要注意的地方吗?
- 将"留言"这个"Big-Cell"
- 4.2 解决逻辑的独立性
> 以闲鱼的详情业务场景为例,其中有两个"Big-Cell":留言和推荐。如果我们将留言和推荐以 Component 形态来组装,就会使得留言和推荐成为两个非常巨大的 Widget,极大的影响了页面的 FPS。
- 4.3
> 以闲鱼的详情业务场景为例,其中有两个"Big-Cell":留言和推荐。如果我们将留言和推荐以 Component 形态来组装,就会使得留言和推荐成为两个非常巨大的 Widget,极大的影响了页面的 FPS。
4.2 和 4.3 重复了.
4.1.2 内容缺失
非得手动点个按钮执行个action,要是没按钮就得重新跑了,好不方便。
初学,提示Is your project missing an android/AndroidManifest.xml?
我这个文章https://medium.com/flutter-community/reactive-programming-streams-bloc-6f0d2bd2d248 里看到这个优化点,想咨询下,是否可以替换呢?
这样比较容易大家都搜得到,更好使用吧
实际阅读文档感觉太分散了,每个.md 文件的内容也没有多少,放在一个文件里可能阅读体验更好,在涉及到其他概念时就不用再去目录找了直接点击就可以跳转到对应的地方
有更详细的官方文档吗?
没有看到使用这个broadcast,有什么作用吗?
如何在 fish redux 中使用 tabcontroller? with 放到哪里呢?
假设组件A dispatch一个action时,会调用自己的effect,如果自己没有消耗掉的话,会进行广播,这时其他组件也会调用自己的effect。
这里我有两个问题:
static Middleware<T> _applyOnAction<T>(OnAction onAction, Context<T> ctx) {
return ({Dispatch dispatch, Get<T> getState}) {
return (Dispatch next) {
return (Action action) {
final Object result = onAction?.call(action);
if (result != null && result != false) {
return;
}
//skip-lifecycle-actions
if (action.type is Lifecycle) {
return;
}
if (!shouldBeInterrupttedBeforeReducer(action)) {
ctx.pageBroadcast(action);
}
next(action);
};
};
};
}
}
什么开源一个类似闲鱼的app就好了
生命周期、他的特点,例子好像都没有呈现出来,看文档有点不好理解
晚上我回去试试
类似于阿里的dva框架吗?
As far as I learn from the sample, the adapter is an abstract that provides a subtree of the full state for a specific item (which is controlled by a so-called "Component") in list views. Is my understanding correct?
Why can't we just extract the data of one item and pass it to the view, since we can put the logic (reducers & effects) into the containing component? Is that kind of consideration for Divide and Conquer?
fish-redux中 通过路由传递的参数,怎么在页面中接受使用呢?
Navigator.pushNamed(ctx.context, '/orderDetials',
arguments: {'orderId': action.payload});
我使用 fish redux 的 adapter 做了个pageview,但是当pageview切换时,切换走的pageview就把清理了。使用flutter的statefulwidget时可以使用AutomaticKeepAliveClientMixin使widget免于销毁。当完全使用fish redux该如何实现这个功能?
可以运行,点击就报错。
error: The named parameter 'backgroundCursorColor' isn't defined. (undefined_named_parameter at [sample] lib/todo_edit_page/view.dart:37)
error: The named parameter 'backgroundCursorColor' isn't defined. (undefined_named_parameter at [sample] lib/todo_edit_page/view.dart:63)
运行sample项目的时候会报错
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building _ComponentWidget<TodoEditState>(dirty, state:
flutter: _ComponentState<TodoEditState>#33858):
flutter: 'package:flutter/src/widgets/editable_text.dart': Failed assertion: line 241 pos 15:
flutter: 'backgroundCursorColor != null': is not true.
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter: https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2 new EditableText (package:flutter/src/widgets/editable_text.dart:241:15)
flutter: #3 buildView (package:sample/todo_edit_page/view.dart:31:26)
flutter: #4 _ViewUpdater.buildView (package:fish_redux/src/redux_component/component.dart:143:22)
flutter: #5 _ComponentState.build (package:fish_redux/src/redux_component/component.dart:197:20)
flutter: #6 StatefulElement.build (package:flutter/src/widgets/framework.dart:3825:27)
flutter: #7 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3736:15)
flutter --version
➜ ~ flutter --version
Flutter 1.2.1 • channel dev • https://github.com/flutter/flutter.git
Framework • revision 8661d8aecd (3 weeks ago) • 2019-02-14 19:19:53 -0800
Engine • revision 3757390fa4
Tools • Dart 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)
EditableText
中的backgroundCursorColor
是必填项
来自flutter小白的请教:
如果需要添加类似下面这种监听器
focusNode.addListener((){
if(focusNode.hasFocus){
// do something or dispatch some action
} else {
// other things or dispatch other action
}
})
那么应该在什么哪个位置添加?如果在State中声明focusNode 并初始化, 那么addListener也应该在这个时候就添加了么?但是如果在这个时候添加的话,那么监听器处理函数里面又怎么去dispatch相关的action来另外处理呢?
哈哈哈!等了你一个星期
我们的即将启动一个全新的app,想了解fish_redux是否稳定,包括是否需要一些其他框架做配合,不想项目中后期或有较大的变动
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.