service method

dynamic service(
  1. String serviceName
)

Prepare a client for rest or socketio call.

return FlutterFeathersjsSocketio or FlutterFeathersjsRest, both are standalone client

serviceName is the name of the service you want to call. Should defined on your server

Implementation

service(String serviceName) {
  /// pass the service to the standalone client and return it
  if (this.client == "rest") {
    return this.standaloneRest!.service(serviceName);
  } else if (this.client == "socketio") {
    return this.standaloneSocketio!.service(serviceName);
  } else {
    throw new FeatherJsError(
        type: FeatherJsErrorType.CONFIGURATION_ERROR,
        error: "You have to configure a client before calling this method. ");
  }
}