Created
June 25, 2021 07:02
-
-
Save pinkeshdarji/7e3a813d8f67cc48846eb93af7318ea5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> main() async { | |
WidgetsFlutterBinding. | |
(); | |
final client = StreamChatClient( | |
'ue75xxvdjwwa', | |
logLevel: Level. | |
, | |
); | |
await AppE2EE().generateKeys(); | |
Map<String, dynamic> publicKeyJwk = | |
await AppE2EE().keyPair.publicKey.exportJsonWebKey(); | |
await client.connectUser( | |
User( | |
id: 'Pinkesh', | |
extraData: { | |
'image': 'https://picsum.photos/id/1025/200/300', | |
'publicKey': publicKeyJwk, | |
}, | |
), | |
client.devToken('Pinkesh'), | |
); | |
final channel = client.channel( | |
"messaging", | |
id: "guitarist", | |
extraData: { | |
"name": "Guitarist", | |
"image": "https://source.unsplash.com/5HltXT-6Vgw", | |
"members": ['Pinkesh', 'Jhon'], | |
}, | |
); | |
await channel.watch(); | |
runApp(MyApp( | |
client: client, | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment