slerver_io 0.9.1 copy "slerver_io: ^0.9.1" to clipboard
slerver_io: ^0.9.1 copied to clipboard

This plugin provides client way to interconnect flutter app.

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']
      });
}
5
likes
35
pub points
0%
popularity

Publisher

verified publisherflutter.bixterprise.com

This plugin provides client way to interconnect flutter app.

Homepage
Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, logger

More

Packages that depend on slerver_io