onMessageReceived method
Implementation
@override
RTWebviewChannelEvent? onMessageReceived(dynamic message) {
try {
if (message is! List) return null;
if (message.isEmpty) return null;
var type = message[0];
dynamic data;
try {
if (message.length > 1) {
data = Map<String, dynamic>.from(message[1]);
}
} catch (e) {
if (kDebugMode) {
print(e);
}
}
return RTWebviewChannelEvent(type, data ?? {});
} catch (e, t) {
if (kDebugMode) {
print(e);
print(t);
}
return null;
}
}