main function
void
main()
Implementation
void main() async {
// Avanda.setGraphRoot();
Avanda.setHeaders({'Authorization': 'Bearer blabla'});
Avanda.setConfig(AvandaConfig(rootUrl: "http://192.168.18.5:4000/"));
void startWatching([retrying = false]) async {
AvandaStream? stream1 = await Avanda().service("User/watcherTest").data({'name': 'wale'}).watch();
stream1?.listen((event) {
print(event.getData());
});
//
// AvandaStream? stream2 = await Avanda().service("User/watcherTest").data({'name': 'wale'}).watch();
//
// stream2?.listen((event) {
// print(event.getData());
// });
// Future.delayed(const Duration(seconds: 10),(){
// stream?.send({
// 'name': 'waleoooo'
// });
// });
// Future.delayed(const Duration(seconds: 10),(){
// stream?.close();
// print('CLosing...');
// });
}
startWatching();
// try{
//
// Future.delayed(const Duration(seconds: 10),(){
// res.send({
// 'name': 'wale'
// });
// });
//
// Future.delayed(const Duration(seconds: 20),(){
// res.close();
// print('CLosing...');
// });
// print(res.rawResponse.status);
// print(res.rawResponse.data);
// print(res.getTotalPages());
// }on RequestException catch(e){
// print(e.getResponse().msg);
// }
}