of static method

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

Implementation

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