siri_shortcuts 0.0.1 copy "siri_shortcuts: ^0.0.1" to clipboard
siri_shortcuts: ^0.0.1 copied to clipboard

PlatformiOSmacOS

A Flutter plugin to add user interactivity with Siri Shortcuts.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:siri_shortcuts/siri_shortcuts.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _siriShortcutsPlugin = SiriShortcuts();

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.from(
        colorScheme: ColorScheme.fromSeed(
          seedColor: Colors.red,
          brightness: Brightness.light,
        ),
        useMaterial3: true,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Siri Shortcuts'),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: () async {
              final result = await _siriShortcutsPlugin.createShortcut(
                ShortcutOptions(
                  activityType: 'a',
                  title: 'Hello',
                  suggestedInvocationPhrase: 'Nepal',
                  userInfo: {
                    'hi': 'there',
                  },
                ),
              );

              print(result.status);
              print(result.phrase);
            },
            child: const Text('Create Shortcut'),
          ),
        ),
      ),
    );
  }
}
1
likes
150
points
99
downloads

Publisher

verified publisheracmesoftware.com

Weekly Downloads

A Flutter plugin to add user interactivity with Siri Shortcuts.

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on siri_shortcuts