Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
quetool committed Feb 23, 2024
1 parent 40a593a commit 86ddbc9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions example/dapp/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,16 @@ class _MyHomePageState extends State<MyHomePage> {

void _onRelayMessage(MessageEvent? args) async {
if (args != null) {
final payloadString = await _web3App!.core.crypto.decode(
args.topic,
args.message,
);
final data = jsonDecode(payloadString ?? '{}') as Map<String, dynamic>;
debugPrint(data.toString());
try {
final payloadString = await _web3App!.core.crypto.decode(
args.topic,
args.message,
);
final data = jsonDecode(payloadString ?? '{}') as Map<String, dynamic>;
debugPrint('[$runtimeType] _onRelayMessage data $data');
} catch (e) {
debugPrint('[$runtimeType] _onRelayMessage error $e');
}
}
}
}

0 comments on commit 86ddbc9

Please sign in to comment.