Open andymaking opened 2 years ago
How can i pass the response to an Api
flutterResponse is my data class
@Deprecated("Deprecated in Java") override fun onActivityResult(requestCode: Int, resultCode: Int, data: FlutterResponse) { viewModel = ViewModelProvider(this)[SignUpActivityViewModel::class.java] if (requestCode == RaveConstants.RAVE_REQUEST_CODE) { viewModel.signup(data) val message = data.message; when (resultCode) { RavePayActivity.RESULT_SUCCESS -> { resultPay = resultCode Toast.makeText(this, "SUCCESS", Toast.LENGTH_LONG).show() } RavePayActivity.RESULT_ERROR -> { resultPay = resultCode Toast.makeText(this, "ERROR", Toast.LENGTH_SHORT).show() } RavePayActivity.RESULT_CANCELLED -> { resultPay = resultCode Toast.makeText(this, "CANCELLED", Toast.LENGTH_SHORT).show() } } } else { super.onActivityResult(requestCode, resultCode, data) } }
How can i pass the response to an Api
flutterResponse is my data class
@Deprecated("Deprecated in Java") override fun onActivityResult(requestCode: Int, resultCode: Int, data: FlutterResponse) { viewModel = ViewModelProvider(this)[SignUpActivityViewModel::class.java] if (requestCode == RaveConstants.RAVE_REQUEST_CODE) { viewModel.signup(data) val message = data.message; when (resultCode) { RavePayActivity.RESULT_SUCCESS -> { resultPay = resultCode Toast.makeText(this, "SUCCESS", Toast.LENGTH_LONG).show() } RavePayActivity.RESULT_ERROR -> { resultPay = resultCode Toast.makeText(this, "ERROR", Toast.LENGTH_SHORT).show() } RavePayActivity.RESULT_CANCELLED -> { resultPay = resultCode Toast.makeText(this, "CANCELLED", Toast.LENGTH_SHORT).show() } } } else { super.onActivityResult(requestCode, resultCode, data) } }