ilebora_push 0.0.1 copy "ilebora_push: ^0.0.1" to clipboard
ilebora_push: ^0.0.1 copied to clipboard

BoraPush is a Dart package enabling real-time server-sent events (SSE) communication, providing simple yet powerful tools for server and client-side implementations.

example/main.dart

import 'dart:convert';

import 'package:ilebora_push/ilebora_push.dart';

void main() async {
	Uri uri = Uri.parse('https//:...'); //Your events server url
	Map<String, dynamic> params = {}; //...parameters

	BoraPushClient 
		boraPushClient = BoraPushClient.connect(
			uri:  uri.replace(queryParameters: params),
			withCredentials:true,
			closeOnError:true,
		);

	Stream 
		myStream = boraPushClient.stream;
		myStream.listen((value) {
			try{
				//Conert to JSON
				var jsonResp = jsonDecode(value); 
				//Do something with the response

				print(jsonResp);
				
			}catch(e){
				//Do something on erro
			}
		});
}
2
likes
130
pub points
0%
popularity

Publisher

unverified uploader

BoraPush is a Dart package enabling real-time server-sent events (SSE) communication, providing simple yet powerful tools for server and client-side implementations.

Documentation

API reference

License

MIT (license)

Dependencies

bloc, flutter, flutter_bloc, universal_html

More

Packages that depend on ilebora_push