flutter_siri_suggestions 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 77

flutter_siri_suggestions #

Flutter plugin for exposure on Siri Suggestions.

Note: This plugin only work in iOS.

Getting Started #

Add flutter_siri_suggestions as a dependency in your pubspec.yaml file.

Check out the example directory for a sample app.

Usage #

Import the library via

import 'package:flutter_siri_suggestions/flutter_siri_suggestions.dart';

Example :

FlutterSiriSuggestions.instance.buildActivity(
  FlutterSiriActivity(
     "Open App 👨‍💻",
     isEligibleForSearch: true,
     isEligibleForPrediction: true,
     contentDescription: "Did you enjoy that?",
     suggestedInvocationPhrase: "open my app"
  )
);

FlutterSiriSuggestions.instance.configure(
  onLaunch: (Map<String, dynamic> message) async {
      // Awaken from Siri Suggestion
      // Do what you want :)
  }
);

call buildActivity method if you want.


suggestedInvocationPhrase #

suggestedInvocationPhrase, only available iOS 12+

enjoy! 💃

1.0.1 #

Change README.md

1.0.0 #

Initial commit. flutter_siri_suggestions

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter_siri_suggestions/flutter_siri_suggestions.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initSuggestions();
  }

  void initSuggestions() async {
    FlutterSiriSuggestions.instance.buildActivity(FlutterSiriActivity(
        "Open App 👨‍💻",
        isEligibleForSearch: true,
        isEligibleForPrediction: true,
        contentDescription: "Did you enjoy that?",
        suggestedInvocationPhrase: "open my app"));

    FlutterSiriSuggestions.instance.configure(
        onLaunch: (Map<String, dynamic> message) async {
      //Awaken from Siri Suggestion

      ///// TO DO : do something!
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Siri Suggestions Sample'),
        ),
        body: Center(
          child: Text('Hey man! It\'s me, Bart Simpson! 🙋‍♂️'),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_siri_suggestions: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_siri_suggestions/flutter_siri_suggestions.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
53
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Apr 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test