| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import 'package:plugin_platform_interface/plugin_platform_interface.dart';
- import 'package:shortcut/shortcut_method_channel.dart';
- abstract class FlutterShortcutPlatform extends PlatformInterface {
- /// Constructs a FlutterShortcutPlatform.
- FlutterShortcutPlatform() : super(token: _token);
- static final Object _token = Object();
- static FlutterShortcutPlatform _instance = MethodChannelFlutterShortcut();
- /// The default instance of [FlutterPinnedShortcutPlatform] to use.
- ///
- /// Defaults to [MethodChannelFlutterPinnedShortcut].
- static FlutterShortcutPlatform get instance => _instance;
- /// Platform-specific implementations should set this with their own
- /// platform-specific class that extends [FlutterPinnedShortcutPlatform] when
- /// they register themselves.
- static set instance(FlutterShortcutPlatform instance) {
- PlatformInterface.verifyToken(instance, _token);
- _instance = instance;
- }
- Future<String?> createShortcut({
- required String id,
- required String label,
- required String action,
- String? iconAssetName,
- }) async {
- throw UnimplementedError('platformVersion() has not been implemented.');
- }
- Stream<String> actionStream() {
- throw UnimplementedError('actionStream() has not been implemented.');
- }
- void getLaunchAction(void Function(String action) onActionReceived) {
- throw UnimplementedError('platformVersion() has not been implemented.');
- }
- }
|