onEvent method

void onEvent(
  1. AFScreenID screen,
  2. AFID widget,
  3. dynamic param,
  4. AFFlexibleStateView? stateView,
  5. AFPressedDelegate? onSuccess,
)

Implementation

void onEvent(AFScreenID screen, AFID widget, dynamic param, AFFlexibleStateView? stateView, AFPressedDelegate? onSuccess) {
  final context = AFWireframeExecutionContext(
    screen: screen,
    widget: widget,
    eventParam: param,
    wireframe: this,
    stateView: stateView
  );

  final handled = body(context);
  if(!handled && !enableUINavigation) {
    if(context.isWidget(AFUIWidgetID.buttonBack)) {
      context.navigatePop();
    }
  }

  if(onSuccess != null) {
    onSuccess();
  }
}