Clarify the assert when mimicking twice in a row.
This commit is contained in:
parent
138373718c
commit
f86889cb1b
@ -176,7 +176,18 @@ class MimicableState extends State<Mimicable> {
|
|||||||
/// passing it to a [Mimic] widget. To mimic the child in the
|
/// passing it to a [Mimic] widget. To mimic the child in the
|
||||||
/// [Overlay], consider using [liftToOverlay()] instead.
|
/// [Overlay], consider using [liftToOverlay()] instead.
|
||||||
MimicableHandle startMimic() {
|
MimicableHandle startMimic() {
|
||||||
assert(_placeholderSize == null);
|
assert(() {
|
||||||
|
if (_placeholderSize != null) {
|
||||||
|
throw new WidgetError(
|
||||||
|
'Mimicable started while already active.\n'
|
||||||
|
'When startMimic() or liftToOverlay() is called on a MimicableState, the mimic becomes active. '
|
||||||
|
'While active, it cannot be reactivated until it is stopped. '
|
||||||
|
'To stop a Mimicable started with startMimic(), call the MimicableHandle object\'s stopMimic() method. '
|
||||||
|
'To stop a Mimicable started with liftToOverlay(), call dispose() on the MimicOverlayEntry.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
RenderBox box = context.findRenderObject();
|
RenderBox box = context.findRenderObject();
|
||||||
assert(box != null);
|
assert(box != null);
|
||||||
assert(box.hasSize);
|
assert(box.hasSize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user