flutter_siri_suggestions icon indicating copy to clipboard operation
flutter_siri_suggestions copied to clipboard

Navigate to another page onLanch

Open atheer1419 opened this issue 2 years ago • 1 comments

Hello, i'm trying to navigate the user to another page when she/he use siri suggestion instead of the main page.

This is the code:

 void initSuggestions() async {
    FlutterSiriSuggestions.instance.configure(
        onLaunch: (Map<String, dynamic> message) async {
      debugPrint('[FlutterSiriSuggestions] [onLaunch] $message');
      //Awaken from Siri Suggestion
      ///// TO DO : do something!

      debugPrint(
          "[FlutterSiriSuggestions] Called by ${message['key']} suggestion.");

        Navigator.push(
            context, MaterialPageRoute(builder: (context) => pageTwo()));
    });
}

Unfortunately, it doesn’t work. It still take the user to the main page. 💔

Please help me 🥺

atheer1419 avatar Apr 23 '22 00:04 atheer1419