-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(share_plus): Added excludedActivityTypes support for the iOS platform. #3376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
miquelbeltran
merged 22 commits into
fluttercommunity:main
from
StanleyCocos:feat/add_activity_type
Jun 24, 2025
Merged
Changes from 12 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
07398ae
feat(share_plus): Added excludedActivityTypes support for the iOS pla…
StanleyCocos 64cc1fe
added test parameter
StanleyCocos e3485c8
Merge branch 'main' into feat/add_activity_type
StanleyCocos 5a151b2
fix(share_plus): the ambiguity caused by the parameter name.
StanleyCocos 60b66ef
Merge branch 'main' into feat/add_activity_type
StanleyCocos 67bc12c
add example
StanleyCocos 7a3b5fb
fix dart format
StanleyCocos 80ff165
fix oc format
StanleyCocos 871c742
++
StanleyCocos e9277f9
fix test
StanleyCocos 3c739bd
fix: format
StanleyCocos 54ea30c
update readme.md
StanleyCocos 80dea49
++
StanleyCocos f7e4025
++
StanleyCocos 1bd95c7
feat: Adjust the documentation comments for CupertinoActivityType, re…
StanleyCocos e1279c4
Merge branch 'main' into feat/add_activity_type
StanleyCocos 286c326
fix: rename parameters and refactor the conversion method.
StanleyCocos 78d862d
fix: format
StanleyCocos e167f6b
fix: delete CupertinoActivityTypeValue
StanleyCocos 1076e54
feat: rename parameter
StanleyCocos ea3ff51
fix: test
StanleyCocos d8ccc88
++
StanleyCocos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
packages/share_plus/share_plus/example/lib/excluded_activity_type.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:share_plus/share_plus.dart'; | ||
|
||
class ExcludedActivityTypePage extends StatefulWidget { | ||
final List<CupertinoActivityType>? excludedActivityType; | ||
|
||
const ExcludedActivityTypePage({ | ||
super.key, | ||
this.excludedActivityType, | ||
}); | ||
|
||
@override | ||
State<StatefulWidget> createState() => _ExcludedActivityTypePageState(); | ||
} | ||
|
||
class _ExcludedActivityTypePageState extends State<ExcludedActivityTypePage> { | ||
final List<String> options = []; | ||
final List<String> selected = []; | ||
|
||
@override | ||
void initState() { | ||
for (final type in CupertinoActivityType.values) { | ||
options.add(type.value); | ||
} | ||
if (widget.excludedActivityType != null && | ||
widget.excludedActivityType!.isNotEmpty) { | ||
for (final type in widget.excludedActivityType!) { | ||
selected.add(type.value); | ||
} | ||
} | ||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('Excluded Activity Type'), | ||
actions: [ | ||
IconButton( | ||
icon: const Icon(Icons.check), | ||
onPressed: () { | ||
final List<CupertinoActivityType> tempSelected = []; | ||
for (final String type in selected) { | ||
tempSelected.add( | ||
CupertinoActivityType.values | ||
.firstWhere((e) => e.value == type), | ||
); | ||
} | ||
Navigator.pop(context, tempSelected); | ||
}, | ||
), | ||
], | ||
), | ||
body: ListView( | ||
children: options.map((option) { | ||
return CheckboxListTile( | ||
value: selected.contains(option), | ||
title: Text(option), | ||
controlAffinity: ListTileControlAffinity.leading, | ||
onChanged: (bool? checked) { | ||
setState(() { | ||
if (checked == true) { | ||
selected.add(option); | ||
} else { | ||
selected.remove(option); | ||
} | ||
}); | ||
}, | ||
); | ||
}).toList(), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small formatting suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't devs check the
CupertinoActivityType
enum instead of the Apple docs?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You’re right, it should be based on CupertinoActivityType first.