initializedSMSStream method
Implementation
@override
Future<void> initializedSMSStream() async {
eventChannel.receiveBroadcastStream().listen((data) {
if (data is Map) {
final Map<String, String> smsData = {
"sender": data["sender"] as String? ?? "",
"body": data["body"] as String? ?? "",
};
_smsController.add(smsData);
}
}, onError: (error) {
print("Error in receiving SMS event :$error");
});
}