File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
packages/stream_video_flutter/example/lib Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,11 @@ class TokenService {
1919
2020 Future <TokenResponse > loadToken ({
2121 required String userId,
22+ required Environment environment,
2223 Duration ? expiresIn,
2324 }) async {
2425 final queryParameters = < String , dynamic > {
25- 'environment' : 'demo' ,
26+ 'environment' : environment.alias ,
2627 'user_id' : userId,
2728 };
2829 if (expiresIn != null ) {
@@ -41,3 +42,12 @@ class TokenService {
4142 return TokenResponse .fromJson (body);
4243 }
4344}
45+
46+ enum Environment {
47+ pronto ('pronto' ),
48+ demo ('demo' );
49+
50+ const Environment (this .alias);
51+
52+ final String alias;
53+ }
Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ Future<void> main() async {
2323Future <Result <None >> _connectUser (UserInfo user) async {
2424 streamLog.i (_tag, () => '[connectUser] user: $user ' );
2525
26- final tokenResponse = await const TokenService ().loadToken (userId: user.id);
26+ final tokenResponse = await const TokenService ().loadToken (
27+ environment: Environment .demo,
28+ userId: user.id,
29+ );
2730
2831 final client = StreamVideo (
2932 tokenResponse.apiKey,
You can’t perform that action at this time.
0 commit comments