Client class
SO Platform Client.
Constructors
- Client(String host, String application, [int deviceWidth = 1024, int deviceHeight = 768, dynamic secured = true, String apiKey = "", Duration? pingInterval])
-
Constructor that takes the host name,
applicationname,deviceWidthanddeviceHeight. Thesecuredparameter determines whether the connection should use TLS encryption or not.
Properties
- apiKey → String
-
API key
final
- apiVersion → int
-
API version
final
- application → String
-
Application name
final
- deviceHeight → int
-
Device height
final
- deviceWidth → int
-
Device width
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- username → String
-
Get the current username.
no setter
Methods
-
changePassword(
String currentPassword, String newPassword) → Future< String> -
Change the
currentPasswordtonewPassword. -
checkPassword(
String password) → bool -
Check if the
passwordpassed is the current password or not. -
command(
String command, Map< String, dynamic> attributes, [bool preserveServerState = false]) → Future<Map< String, dynamic> > - Send a command and get the response.
-
file(
String name) → Future< (Uint8List?, String?, String?)> -
Retrieve stream of data from a file with
name(This could be the name of the file or Id of the file). -
info(
String command, Map< String, dynamic> attributes) → Future<Map< String, dynamic> > - Send a command to retrieve information from the server that doesn't require access rights.
-
login(
String username, [String password = '']) → Future< String> - Login. Requires username, password is optional.
-
logout(
) → Future< void> - Logout.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
otp(
String email, [String mobile = '']) → Future< Map< String, dynamic> > - Command to initiate an OTP-based login. Server will generate OTPs and send them to the email address and/or mobile.
-
otpLogin(
int emailOTP, [int mobileOTP = 0]) → Future< String> - OTP-based login. OTPs must have been generated using otp before calling this method.
-
report(
String logic, [Map< String, dynamic> ? parameters]) → Future<(Uint8List?, String?, String?)> -
Retrieve stream of data from a file with
name(This could be the name of the file or Id of the file). -
stream(
String name) → Future< (Uint8List?, String?, String?)> -
Retrieve stream of data for the
name. -
toString(
) → String -
A string representation of this object.
inherited
-
upload(
String mimeType, Uint8List data, [String streamNameOrID = '']) → Future< Map< String, dynamic> > -
Upload some binary
datato the server.mimeTypeof the content should be correctly specified and it will not be verified at the server. -
uploadStream(
String mimeType, Stream< Uint8List> data, [String streamNameOrID = '']) → Future<Map< String, dynamic> > -
Upload a stream of binary
datato the server.mimeTypeof the content should be correctly specified and it will not be verified at the server.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited