fix: 部分代码添加 mounted

This commit is contained in:
ryan
2019-02-02 23:57:18 +08:00
parent 57a253e508
commit 3238c3b67f
17 changed files with 164 additions and 112 deletions

View File

@ -30,9 +30,11 @@ class _CheckboxDefault extends State {
tristate:false,
value: isChecked,
onChanged: (bool bol) {
setState((){
isChecked = bol;
});
if(mounted) {
setState(() {
isChecked = bol;
});
}
}
);
}
@ -58,9 +60,11 @@ class CheckboxSelect extends StatelessWidget {
tristate:false,
value: parent.selectValue == this.index,
onChanged: (bool bol) {
parent.setState((){
parent.selectValue = bol ? this.index : -1;
});
if(parent.mounted) {
parent.setState(() {
parent.selectValue = bol ? this.index : -1;
});
}
}
);
}