alibaba / fish-redux

An assembled flutter application framework.
https://github.com/alibaba/fish-redux
Apache License 2.0
7.33k stars 843 forks source link

在现有的Page文件结构中,新增的Reducer函数无法热部署; #579

Open jol5 opened 4 years ago

jol5 commented 4 years ago

Describe the bug A clear and concise description of what the bug is. Show the code you wrote as completely as possible.

/// your code here
LoginState _showClearIcon(LoginState state, Action action) {
  final LoginState newState = state.clone()..hideClearIcon = state.usernameController.text.length <= 0;
  return newState;
}
以上为新增的函数,还有与之对应的Action函数

To Reproduce Steps to reproduce the behavior. 1.新增一个Action动作; 2.新增该动作的处理函数 3.在View中触发该Action

Expected behavior A clear and concise description of what you expected to happen. Action函数触发了,但是与之对应的Reducr函数,没有被调用到。

解决: 需要重启项目。 Additional context

  1. The version of fish-redux which you are using. fish_redux: ^0.3.1
  2. The information from flutter doctor. Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel beta, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.18363.535], locale zh-CN)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [√] Android Studio (version 3.5) [!] IntelliJ IDEA Ultimate Edition (version 2019.2) X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. [√] Connected device (1 available)

adigest commented 4 years ago

应该是flutter的bug吧。 写在initstate里的东西,不会热更新 可以暂时移到build里,或者重新打开页面,或者重启项目通过attach进去

jol5 commented 4 years ago

应该是flutter的bug吧。 写在initstate里的东西,不会热更新 可以暂时移到build里,或者重新打开页面,或者重启项目通过attach进去

好像是。目前我只能重启项目区解决了;

adigest commented 4 years ago

应该是flutter的bug吧。 写在initstate里的东西,不会热更新 可以暂时移到build里,或者重新打开页面,或者重启项目通过attach进去

好像是。目前我只能重启项目区解决了;

可以考虑用reassemble,毕竟重启需要重新安装一遍,等待太耗时

HongxiangShe commented 4 years ago

vscode 的话, press 'R' to hot restart