Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InheritedWidget章节代码注释问题 #129

Closed
qzcsfchh opened this issue Mar 13, 2019 · 1 comment
Closed

InheritedWidget章节代码注释问题 #129

qzcsfchh opened this issue Mar 13, 2019 · 1 comment

Comments

@qzcsfchh
Copy link

InheritedWidget章节中,应该是返回true则依赖本控件data的子树会执行didChangeDependencies()回调,原文是false
原文:

  //该回调决定当data发生变化时,是否通知子树中依赖data的Widget  
  @override
  bool updateShouldNotify(ShareDataWidget old) {
    //如果返回false,则子树中依赖(build函数中有调用)本widget
    //的子widget的`state.didChangeDependencies`会被调用
    return old.data != data;
  }
@wendux
Copy link
Member

wendux commented Mar 14, 2019

已修改

@wendux wendux closed this as completed Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants