Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
929fdea
[quick_actions] add localizedSubtitle for iOS
GiacomoPignoni Jun 23, 2024
4bea2bc
test and changelog
GiacomoPignoni Jun 23, 2024
fd8a73a
add deps override
GiacomoPignoni Jun 26, 2024
4cba4da
update ios changelog
GiacomoPignoni Jun 26, 2024
1886a75
update platform interface changelog
GiacomoPignoni Jun 26, 2024
3dd729f
Merge branch 'main' into quick_action/subtitle
sinyu1012 Nov 8, 2024
bf72048
update changelog
sinyu1012 Nov 8, 2024
a0ac67e
revert quick_actions_android changes
sinyu1012 Nov 8, 2024
ce569d9
opt QuickActionsPlugin
sinyu1012 Nov 8, 2024
2bf8256
update notes
sinyu1012 Nov 8, 2024
f644114
update quick_actions_ios example & UITests
sinyu1012 Nov 13, 2024
4b38b32
format quick_actions_ios/messages.g.swift
sinyu1012 Nov 13, 2024
54e0a39
format swift
sinyu1012 Nov 13, 2024
550dfe3
Update packages/quick_actions/quick_actions_android/example/pubspec.yaml
sinyu1012 Nov 15, 2024
977992e
Update packages/quick_actions/quick_actions_android/pubspec.yaml
sinyu1012 Nov 15, 2024
3568750
update quick_actions example code
sinyu1012 Nov 15, 2024
9fca7cf
Merge branch 'main' into quick_action/subtitle
sinyu1012 Nov 22, 2024
ee8dc3f
update dependencies
sinyu1012 Nov 22, 2024
efb9975
format code
sinyu1012 Nov 22, 2024
8782df8
format code
sinyu1012 Nov 22, 2024
52eb23b
update version
sinyu1012 Nov 22, 2024
4783ff8
Merge branch 'main' into quick_action/subtitle
sinyu1012 Dec 10, 2024
8d663b7
Merge branch 'main' into quick_action/subtitle
sinyu1012 Dec 11, 2024
f42fb39
update dependencies
sinyu1012 Dec 11, 2024
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
Prev Previous commit
Next Next commit
test and changelog
  • Loading branch information
GiacomoPignoni committed Jun 23, 2024
commit 4bea2bc257123a9d33804569d7f244a2ec3cabbe
1 change: 1 addition & 0 deletions packages/quick_actions/quick_actions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT

* Add localizedSubtitle field for iOS
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.

## 1.0.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,28 @@ void main() {

test('setShortcutItems', () async {
await quickActions.initialize((String type) {});
const ShortcutItem item =
ShortcutItem(type: 'test', localizedTitle: 'title', icon: 'icon.svg');
const ShortcutItem item = ShortcutItem(
type: 'test',
localizedTitle: 'title',
localizedSubtitle: 'subtitle',
icon: 'icon.svg',
);
await quickActions.setShortcutItems(<ShortcutItem>[item]);

expect(api.items.first.type, item.type);
expect(api.items.first.localizedTitle, item.localizedTitle);
expect(api.items.first.localizedSubtitle, item.localizedSubtitle);
expect(api.items.first.icon, item.icon);
});

test('clearShortCutItems', () {
quickActions.initialize((String type) {});
const ShortcutItem item =
ShortcutItem(type: 'test', localizedTitle: 'title', icon: 'icon.svg');
const ShortcutItem item = ShortcutItem(
type: 'test',
localizedTitle: 'title',
localizedSubtitle: 'subtitle',
icon: 'icon.svg',
);
quickActions.setShortcutItems(<ShortcutItem>[item]);
quickActions.clearShortcutItems();

Expand All @@ -48,13 +57,19 @@ void main() {
test('Shortcut item can be constructed', () {
const String type = 'type';
const String localizedTitle = 'title';
const String localizedSubtitle = 'subtitle';
const String icon = 'foo';

const ShortcutItem item =
ShortcutItem(type: type, localizedTitle: localizedTitle, icon: icon);
const ShortcutItem item = ShortcutItem(
type: type,
localizedTitle: localizedTitle,
localizedSubtitle: localizedSubtitle,
icon: icon,
);

expect(item.type, type);
expect(item.localizedTitle, localizedTitle);
expect(item.localizedSubtitle, localizedSubtitle);
expect(item.icon, icon);
});
}
Expand Down Expand Up @@ -83,6 +98,7 @@ ShortcutItem shortcutItemMessageToShortcutItem(ShortcutItemMessage item) {
return ShortcutItem(
type: item.type,
localizedTitle: item.localizedTitle,
localizedSubtitle: item.localizedSubtitle,
icon: item.icon,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class MethodChannelQuickActions extends QuickActionsPlatform {
return <String, String?>{
'type': item.type,
'localizedTitle': item.localizedTitle,
'localizedSubtitle': item.localizedSubtitle,
if (item.localizedSubtitle != null)
'localizedSubtitle': item.localizedSubtitle,
'icon': item.icon,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,38 @@ void main() {
quickActions.initialize((String type) {});
quickActions.setShortcutItems(<ShortcutItem>[
const ShortcutItem(
type: 'test', localizedTitle: 'title', icon: 'icon.svg')
type: 'test',
localizedTitle: 'title',
localizedSubtitle: 'subtitle',
icon: 'icon.svg',
)
]);

expect(
log,
<Matcher>[
isMethodCall('getLaunchAction', arguments: null),
isMethodCall('setShortcutItems', arguments: <Map<String, String>>[
<String, String>{
'type': 'test',
'localizedTitle': 'title',
'localizedSubtitle': 'subtitle',
'icon': 'icon.svg',
}
]),
],
);
});

test('passes shortcutItem through channel with null localizedSubtitle',
() {
quickActions.initialize((String type) {});
quickActions.setShortcutItems(<ShortcutItem>[
const ShortcutItem(
type: 'test',
localizedTitle: 'title',
icon: 'icon.svg',
)
]);

expect(
Expand All @@ -82,10 +113,15 @@ void main() {
test('setShortcutItems with demo data', () async {
const String type = 'type';
const String localizedTitle = 'localizedTitle';
const String localizedSubtitle = 'localizedSubtitle';
const String icon = 'icon';
await quickActions.setShortcutItems(
const <ShortcutItem>[
ShortcutItem(type: type, localizedTitle: localizedTitle, icon: icon)
ShortcutItem(
type: type,
localizedTitle: localizedTitle,
localizedSubtitle: localizedSubtitle,
icon: icon)
],
);
expect(
Expand All @@ -97,6 +133,7 @@ void main() {
<String, String>{
'type': type,
'localizedTitle': localizedTitle,
'localizedSubtitle': localizedSubtitle,
'icon': icon,
}
],
Expand Down Expand Up @@ -138,13 +175,19 @@ void main() {
test('Shortcut item can be constructed', () {
const String type = 'type';
const String localizedTitle = 'title';
const String localizedSubtitle = 'subtitle';
const String icon = 'foo';

const ShortcutItem item =
ShortcutItem(type: type, localizedTitle: localizedTitle, icon: icon);
const ShortcutItem item = ShortcutItem(
type: type,
localizedTitle: localizedTitle,
localizedSubtitle: localizedSubtitle,
icon: icon,
);

expect(item.type, type);
expect(item.localizedTitle, localizedTitle);
expect(item.localizedSubtitle, localizedSubtitle);
expect(item.icon, icon);
});
});
Expand Down