validation method
Implementation
Future<Payload> validation() async {
if (hasReportedErrors()) {
throw PlatformException(
code: error.code,
message: error.message,
details: error.details,
);
} else {
return payload;
}
}