@@ -54,7 +54,7 @@ class _MyHomePageState extends State<MyHomePage> {
5454 ],
5555 redirect: Redirect (
5656 native : 'web3modalflutter://' ,
57- universal: 'https://walletconnect.com/appkit' ,
57+ // universal: 'https://walletconnect.com/appkit',
5858 ),
5959 );
6060
@@ -74,7 +74,7 @@ class _MyHomePageState extends State<MyHomePage> {
7474 getMessageParams: () async {
7575 // Provide everything that is needed to construct the SIWE message
7676 debugPrint ('[SIWEConfig] getMessageParams()' );
77- final uri = Uri .parse (_pairingMetadata.redirect! .universal ! );
77+ final uri = Uri .parse (_pairingMetadata.redirect! .native ! );
7878 return SIWEMessageArgs (
7979 domain: uri.authority,
8080 uri: 'https://walletconnect.com/login' ,
@@ -93,7 +93,7 @@ class _MyHomePageState extends State<MyHomePage> {
9393 try {
9494 debugPrint ('[SIWEConfig] verifyMessage()' );
9595 final payload = args.toJson ();
96- final uri = Uri .parse (_pairingMetadata.redirect! .universal ! );
96+ final uri = Uri .parse (_pairingMetadata.redirect! .native ! );
9797 final result = await _siweTestService.verifyMessage (
9898 payload,
9999 domain: uri.authority,
@@ -253,9 +253,9 @@ class _MyHomePageState extends State<MyHomePage> {
253253 super .dispose ();
254254 }
255255
256- void _onModalConnect (ModalConnect ? event) {
257- debugPrint ('[ExampleApp] _onModalConnect ${event ?.toString ()}' );
256+ void _onModalConnect (ModalConnect ? event) async {
258257 setState (() {});
258+ debugPrint ('[ExampleApp] _onModalConnect ${event ?.session .toJson ()}' );
259259 }
260260
261261 void _onModalUpdate (ModalConnect ? event) {
@@ -304,8 +304,8 @@ class _MyHomePageState extends State<MyHomePage> {
304304 }
305305
306306 void _onRelayClientError (EventArgs ? event) {
307- debugPrint ('[ExampleApp] _onRelayClientError ${event ?.toString ()}' );
308307 setState (() {});
308+ showTextToast (text: 'Relay disconnected' , context: context);
309309 }
310310
311311 void _onRelayClientDisconnect (EventArgs ? event) {
@@ -364,13 +364,20 @@ class _MyHomePageState extends State<MyHomePage> {
364364 },
365365 );
366366 },
367+ floatingActionButton: CircleAvatar (
368+ radius: 6.0 ,
369+ backgroundColor: _initialized &&
370+ _w3mService.web3App? .core.relayClient.isConnected == true
371+ ? Colors .green
372+ : Colors .red,
373+ ),
367374 );
368375 }
369376
370377 Future <void > _refreshData () async {
378+ await _w3mService.reconnectRelay ();
371379 await _w3mService.loadAccountData ();
372380 setState (() {});
373- return ;
374381 }
375382}
376383
0 commit comments