of static method

ExpandableController? of(
  1. BuildContext context, {
  2. bool rebuildOnChange = true,
  3. bool required = false,
})

Implementation

static ExpandableController? of(BuildContext context,
    {bool rebuildOnChange = true, bool required = false}) {
  final notifier = rebuildOnChange
      ? context
          .dependOnInheritedWidgetOfExactType<_ExpandableControllerNotifier>()
      : context
          .findAncestorWidgetOfExactType<_ExpandableControllerNotifier>();
  assert(notifier != null || !required,
      "ExpandableNotifier is not found in widget tree");
  return notifier?.notifier;
}