Skip to content

flutter run issues #5

Description

@answer0732

hi, i am using this plugin for my app, but throw a problem

e: D:\flutter\.pub-cache\hosted\pub.flutter-io.cn\android_notification_listener2-2.0.1\android\src\main\kotlin\com\emilecode\android_notification_listener2\AndroidNotificationListener2Plugin.kt: (73, 28): Type mismatch: inferred type is String? but TypeVariable(V) was expected
e: D:\flutter\.pub-cache\hosted\pub.flutter-io.cn\android_notification_listener2-2.0.1\android\src\main\kotlin\com\emilecode\android_notification_listener2\AndroidNotificationListener2Plugin.kt: (74, 31): Type mismatch: inferred type is String? but TypeVariable(V) was expected
e: D:\flutter\.pub-cache\hosted\pub.flutter-io.cn\android_notification_listener2-2.0.1\android\src\main\kotlin\com\emilecode\android_notification_listener2\AndroidNotificationListener2Plugin.kt: (75, 28): Type mismatch: inferred type is String? but TypeVariable(V) was expected
e: D:\flutter\.pub-cache\hosted\pub.flutter-io.cn\android_notification_listener2-2.0.1\android\src\main\kotlin\com\emilecode\android_notification_listener2\AndroidNotificationListener2Plugin.kt: (76, 29): Type mismatch: inferred type is String? but TypeVariable(V) was expected

this is your code:

  internal inner class NotificationReceiver : BroadcastReceiver() {
    val TAG = "NOTIFICATION_RECEIVER"
    override fun onReceive(context: Context, intent: Intent) {
      val packageName = intent.getStringExtra(NotificationListener.NOTIFICATION_PACKAGE_NAME)
      val packageMessage = intent.getStringExtra(NotificationListener.NOTIFICATION_PACKAGE_MESSAGE)
      val packageText = intent.getStringExtra(NotificationListener.NOTIFICATION_PACKAGE_TEXT)
      val packageExtra = intent.getStringExtra(NotificationListener.NOTIFICATION_PACKAGE_EXTRA)
      val map = HashMap<String, Any>()
      map["packageName"] = packageName
      map["packageMessage"] = packageMessage
      map["packageText"] = packageText
      map["packageExtra"] = packageExtra
      eventSink?.success(map)
    }
  }

how to fix this, thanks !

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions