of static method

IndentGuide of(
  1. BuildContext context
)

The IndentGuide from the closest instance of this class that encloses the given context.

If there is no DefaultIndentGuide ancestor in the widget tree at the given context, then this will return a ConnectingLinesGuide with its default constructor values.

Typical usage is as follows:

IndentGuide guide = DefaultIndentGuide.of(context);

Implementation

static IndentGuide of(BuildContext context) {
  final DefaultIndentGuide? instance =
      context.dependOnInheritedWidgetOfExactType<DefaultIndentGuide>();

  return instance?.guide ?? const ConnectingLinesGuide();
}