| 1 | import 'package:flutter/services.dart'; |
| 2 | |
| 3 | class QuickLaunchService { |
| 4 | static const _channel = MethodChannel('com.localmind/shortcuts'); |
| 5 | |
| 6 | static Future<void> setupShortcuts() async { |
| 7 | try { |
| 8 | await _channel.invokeMethod('setupShortcuts', { |
| 9 | 'shortcuts': [ |
| 10 | { |
| 11 | 'id': 'new_chat', |
| 12 | 'title': 'New Chat', |
| 13 | 'description': 'Start a new conversation', |
| 14 | 'icon': 'ic_chat', |
| 15 | }, |
| 16 | ], |
| 17 | }); |
| 18 | } on PlatformException { |
| 19 | // Not supported on this platform, ignore |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | static Future<void> handleShortcut(String shortcutId) async { |
| 24 | // This is called from native side via method channel |
| 25 | // Implementation depends on routing setup |
| 26 | } |
| 27 | } |