Open
Description
Use case
Native iOS quick actions allow the use of an SF Symbol as an icon. Right now this is not possible with the quick_actions package.
Proposal
I think something like this react-native package is doing could be good.
The following is what I am using in my app right now.
--- a/packages/quick_actions/quick_actions_ios/ios/quick_actions_ios/Sources/quick_actions_ios/QuickActionsPlugin.swift
+++ b/packages/quick_actions/quick_actions_ios/ios/quick_actions_ios/Sources/quick_actions_ios/QuickActionsPlugin.swift
@@ -90,8 +90,13 @@ public final class QuickActionsPlugin: NSObject, FlutterPlugin, IOSQuickActionsA
-> UIApplicationShortcutItem?
{
- let icon = (shortcut.icon).map {
- UIApplicationShortcutIcon(templateImageName: $0)
+ let icon = (shortcut.icon).map { iconName in
+ if iconName.hasPrefix("symbol:") {
+ let systemImageName = String(iconName.dropFirst("symbol:".count))
+ return UIApplicationShortcutIcon(systemImageName: systemImageName)
+ } else {
+ return UIApplicationShortcutIcon(templateImageName: iconName)
+ }
}
// type and localizedTitle are required.
This is how it would be used on the dart side:
ShortcutItem(
type: 'scan',
localizedTitle: 'Scan',
icon: 'symbol:qrcode',
),