GeneralCallback<T>.simple constructor Null safety

GeneralCallback<T>.simple(
  1. BuildContext context,
  2. dynamic onSuccess(
    1. T data
    )
)

Implementation

factory GeneralCallback.simple(
  BuildContext context,
  Function(T data) onSuccess,
) {
  return GeneralCallback<T>(
    onFailure: (DioError e) => ApUtils.showToast(context, e.i18nMessage),
    onError: (GeneralResponse e) => ApUtils.showToast(context, e.message),
    onSuccess: onSuccess,
  );
}