debugDescribeFocusTree function Null safety

String debugDescribeFocusTree()

Returns a text representation of the current focus tree, along with the current attributes on each node.

Will return an empty string in release builds.

Implementation

String debugDescribeFocusTree() {
  assert(WidgetsBinding.instance != null);
  String? result;
  assert(() {
    result = FocusManager.instance.toStringDeep();
    return true;
  }());
  return result ?? '';
}