performReassemble method

  1. @override
Future<void> performReassemble ()
override

This method is called by reassembleApplication to actually cause the application to reassemble, e.g. after a hot reload.

Bindings are expected to use this method to reregister anything that uses closures, so that they do not keep pointing to old code, and to flush any caches of previously computed values, in case the new code would compute them differently. For example, the rendering layer triggers the entire application to repaint when this is called.

Do not call this method directly. Instead, use reassembleApplication.

Implementation

@override
Future<void> performReassemble() {
  assert(() {
    WidgetInspectorService.instance.performReassemble();
    return true;
  }());

  deferFirstFrameReport();
  if (renderViewElement != null)
    buildOwner.reassemble(renderViewElement);
  return super.performReassemble().then((void value) {
    allowFirstFrameReport();
  });
}