Error Message for createState assertion (#44610)
* Init * Added error message to assert * Removing unrelated changes
This commit is contained in:
parent
b1ca7f419e
commit
ae62a3cf1b
@ -4055,7 +4055,12 @@ class StatefulElement extends ComponentElement {
|
|||||||
}());
|
}());
|
||||||
assert(_state._element == null);
|
assert(_state._element == null);
|
||||||
_state._element = this;
|
_state._element = this;
|
||||||
assert(_state._widget == null);
|
assert(
|
||||||
|
_state._widget == null,
|
||||||
|
'The createState function for $widget returned an old or invalid state '
|
||||||
|
'instance: ${_state._widget}, which is not null, violating the contract '
|
||||||
|
'for createState.',
|
||||||
|
);
|
||||||
_state._widget = widget;
|
_state._widget = widget;
|
||||||
assert(_state._debugLifecycleState == _StateLifecycle.created);
|
assert(_state._debugLifecycleState == _StateLifecycle.created);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user