You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to connect P2P messaging, token generation handled by backend dev. While implementing on flutter, it stuck on loading. I would greatly appreciate any guidance on this matter.
Thank you,
This is the demo version
classChatPageextendsStatelessWidget {
Future<(StreamChatClient, Channel)?> get streamFuture async {
final client =StreamChatClient(StreamMessageConfig.streamApiKey,
logLevel:Level.INFO);
final channel = client.channel('messaging'); //also tried with idfinal streamToken =await locator.get<AppConfig>().getStreamToken();
final result =await client.connectUser(
User(id:"testUser_d204c43a-b26a-428c-8c06-65242d2d8374"),
streamToken!); //fine hereprint("connected user $result user");
// channel.watch(); //tried with it herereturn (client, channel);
}
@overrideWidgetbuild(BuildContext context) {
returnScaffold(
body:SafeArea(
child:FutureBuilder<(StreamChatClient, Channel)?>(
future: streamFuture,
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.hasError) {
returnText("Something went wrong ${snapshot.error}");
} elseif (snapshot.connectionState ==ConnectionState.waiting) {
returnconstCenter(child:Text("Loading"));
} elseif (snapshot.hasData && snapshot.data !=null) {
final data = snapshot.data as (StreamChatClient, Channel);
returnStreamChat(
client: data.$1,
child:Builder(
builder: (context) {
returnStreamChannel(
channel: data.$2,
loadingBuilder: (ctx) =>constCenter(child:Text("channel Loading")),
child:StreamMessageListView(loadingBuilder: (ctx) {
returnconstCenter(child:Text("chat Loading"));//stuck here
}),
errorBuilder: (ctx, obj, st) {
returnCenter(
child:Text("Error ${st}"),
);
},
);
},
),
);
}
returnconstText("NA State");
},
),
),
);
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am trying to connect P2P messaging, token generation handled by backend dev. While implementing on flutter, it stuck on loading. I would greatly appreciate any guidance on this matter.
Thank you,
This is the demo version
console log
Beta Was this translation helpful? Give feedback.
All reactions