GeneralCallback<T>.simple constructor

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: (DioException e) => ApUtils.showToast(context, e.i18nMessage),
    onError: (GeneralResponse e) => ApUtils.showToast(context, e.message),
    onSuccess: onSuccess,
  );
}