captureLazyState method

VoidCallback captureLazyState()

Captures mutable builder state for failed lazy-registration rollback. Subclasses with additional state must extend this rollback.

Implementation

VoidCallback captureLazyState() {
  final layouts = List<TypeDescriptor<LayoutConfiguration>>.of(_layouts);
  final layout = _defaultLayout;
  final descriptor = _defaultLayoutDescriptor;
  return () {
    _layouts
      ..clear()
      ..addAll(layouts);
    _defaultLayout = layout;
    _defaultLayoutDescriptor = descriptor;
  };
}