ShoutSocial / share_handler

A plugin to facilitate receiving and handling share intents
41 stars 39 forks source link

How to route to custom page? #83

Open chris-yeung opened 7 months ago

chris-yeung commented 7 months ago

In the example, it works when share content to the app. But how to share content with directing to open app and route to certain page?

I try place the ShareHandler in the second page, but after i click share, the app open, but it still is the first page, however, when i go second page, i see the file, but what i want is direct to second page.

Thank you, is anyone has idea of this?

Future initPlatformState() async { final handler = ShareHandler.instance; media = await handler.getInitialSharedMedia();

print("media---");
handler.sharedMediaStream.listen((SharedMedia media) {
  print(media);
  if (!mounted) return;
  setState(() {
    this.media = media;
  });
});
if (!mounted) return;

setState(() {
  // _platformVersion = platformVersion;
});

}

Mounix99 commented 6 months ago

Check the example in this video