of static method

Log? of(
  1. BuildContext context, {
  2. required bool listen,
})

Implementation

static Log? of(
  BuildContext context, {
  required bool listen,
}) {
  final widget = listen
      ? context.dependOnInheritedWidgetOfExactType<Loggable>()!
      : context.getElementForInheritedWidgetOfExactType<Loggable>()!.widget
          as Loggable;

  return widget.log;
}