of static method

BasePrefService of(
  1. BuildContext context, {
  2. bool listen = true,
})

Implementation

static BasePrefService of(BuildContext context, {bool listen = true}) {
  if (listen) {
    return context.dependOnInheritedWidgetOfExactType<PrefService>()!.service;
  }

  return context.findAncestorWidgetOfExactType<PrefService>()!.service;
}