better_web_socket 0.0.2 better_web_socket: ^0.0.2 copied to clipboard
Advanced web socket based on web_socket_channel.
better_web_socket #
Advanced web socket based on web_socket_channel.
Install Started #
- Add this to your pubspec.yaml file:
dependencies:
better_web_socket: ^0.0.2
- Install it
$ flutter packages get
Normal usage #
context.read<DeviceWebSocketController>().startWebSocketConnect(
(data) async {
setState(() {
receiveDataList
.add("${DateTime.now().toString().substring(0, 19)} $data");
scrollController.animateTo(0,
duration: Duration(milliseconds: 350), curve: Curves.linear);
});
},
pingInterval: Duration(seconds: 15),
);
Feature #
- reconnect
- delay disconnect
- login logic