Skip to content
This repository was archived by the owner on Jul 21, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ private void text(Object arguments) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType(mimeType);
shareIntent.putExtra(Intent.EXTRA_TEXT, text);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, title);
activeContext.startActivity(Intent.createChooser(shareIntent, title));
}

Expand All @@ -81,6 +82,7 @@ private void file(Object arguments) {
String fileProviderAuthority = activeContext.getPackageName() + PROVIDER_AUTH_EXT;
Uri contentUri = FileProvider.getUriForFile(activeContext, fileProviderAuthority, file);
shareIntent.putExtra(Intent.EXTRA_STREAM, contentUri);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, title);
// add optional text
if (!text.isEmpty()) shareIntent.putExtra(Intent.EXTRA_TEXT, text);
activeContext.startActivity(Intent.createChooser(shareIntent, title));
Expand Down Expand Up @@ -110,6 +112,7 @@ private void files(Object arguments) {
}

shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, contentUris);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, title);
// add optional text
if (!text.isEmpty()) shareIntent.putExtra(Intent.EXTRA_TEXT, text);
activeContext.startActivity(Intent.createChooser(shareIntent, title));
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
path_provider: ^1.1.0
path_provider: ^2.0.1

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
Expand Down