of<T> static method

AceController<T> of<T>(
  1. BuildContext context, {
  2. bool listen = true,
})

Implementation

static AceController<T> of<T>(BuildContext context, {bool listen = true}) {
  _AceInherited? inherited;
  if (listen) {
    inherited = context.dependOnInheritedWidgetOfExactType<_AceInherited>();
  } else {
    final element =
        context.getElementForInheritedWidgetOfExactType<_AceInherited>();
    inherited = element?.widget as _AceInherited?;
  }
  return inherited!.aceData as AceController<T>;
}