Open MohamedAmineB opened 5 years ago
@MohamedAmineB, you can use the addStatusListener method to know when the client is connected.
Client client = new Client(..., true);
client.addStatusListener((status) {
if (status == ConnectStatus.connected) {
client.login(UserCredentials()
..name = 'admin'
..password = 'admin');
}
});
Hi, thank you very much for this work. I tried to use your realtime Client, as is, but when I create a new Client, as I saw on your test example
Client client = Client(..., true);
and then I try to loginI get an error saying ddp is null To fix this I had to extract the connection bloc of code from the Client constructor and put this lines in a new async method
then call this new connection method with an await prefix
Am I misusing your code? Or should it be corrected?
Thx