Skip to content

Commit 20ab01e

Browse files
committed
use isNullOrBlank on Android
1 parent 35692c1 commit 20ab01e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • packages/share_plus/share_plus/android/src/main/kotlin/dev/fluttercommunity/plus/share

packages/share_plus/share_plus/android/src/main/kotlin/dev/fluttercommunity/plus/share/Share.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ internal class Share(
7474
action = Intent.ACTION_SEND
7575
type = "text/plain"
7676
putExtra(Intent.EXTRA_TEXT, uri ?: text)
77-
if (subject != null) putExtra(Intent.EXTRA_SUBJECT, subject)
78-
if (title != null) putExtra(Intent.EXTRA_TITLE, title)
77+
if (!subject.isNullOrBlank()) putExtra(Intent.EXTRA_SUBJECT, subject)
78+
if (!title.isNullOrBlank()) putExtra(Intent.EXTRA_TITLE, title)
7979
}
8080
} else {
8181
when {
@@ -106,9 +106,9 @@ internal class Share(
106106
}
107107

108108
shareIntent.apply {
109-
if (text != null) putExtra(Intent.EXTRA_TEXT, text)
110-
if (subject != null) putExtra(Intent.EXTRA_SUBJECT, subject)
111-
if (title != null) putExtra(Intent.EXTRA_TITLE, title)
109+
if (!text.isNullOrBlank()) putExtra(Intent.EXTRA_TEXT, text)
110+
if (!subject.isNullOrBlank()) putExtra(Intent.EXTRA_SUBJECT, subject)
111+
if (!title.isNullOrBlank()) putExtra(Intent.EXTRA_TITLE, title)
112112
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
113113
}
114114
}

0 commit comments

Comments
 (0)