SlerverIO
This plugin provides client way to interconnect flutter app.
Learn more at Bixterprise.com
Usage
Lets take a look at how to use SlerverIO
to connect two Flutter app for data sharing on both Android and iOS.
Create the client that we will use to connect.
SlerverIO client;
Initilialize response from flutter Server App.
initClient ( ) async {
client = await SlerverIO.connect('10.42.0.241', 9000, autoReconnect: true);
}
Now we add response triggers by using SlerverIORedirectRoute
from SlerverIO
onResponse ( ) {
var io = client.router;
io
..on('/name', (Map<String, dynamic> params) {
print(params['message']);
})
..on('/surname', (List params) {
print('${params.first} => ${params.last}');
})
..on('connect', () {
print('Connected successfully');
});
}
Now lets define function uses to send data to server
writeSomething() {
client
..send({
'path': '/register',
'params': {'name': 'Bakop', 'surname': 'Champlain'}
})
..send({
'path': '/findAll',
'params': ['Champlain', 'Manuel', 'Cabrel', 'Jordan']
});
}
Libraries
- slerver_io
- The
Slerver_io
library, is a class set that achieves the single goal of how to use a single phone in a wireless smartphone network to centralize data and send it to the server. We have adopted a sockets-based approach to this problem, keeping in mind that the developer must be familiar with the proposed syntax, hence the routes. The implementation of this solution uses 3 classes