In practice, this is rarely an issue. The widget library
ensures that layout is performed before any hit test on all
render objects. This problem is only likely to be seen in
code that directly interacts with render objects, for
example in tests of custom render objects.

Migration guide

If you see the '!debugNeedsLayout': is not true
assertion error while hit testing the RenderEditable,
lay out the RenderEditable before doing so.

Code before migration:

import

'package:flutter/rendering.dart'

import

'package:flutter_test/flutter_test.dart'

import

'package:flutter/material.dart'

void

main

()

test

'attach and detach correctly handle gesture'

()

final

RenderEditable

editable