0

I would like to create a simple app in Flutter that contains for example 3 button , the event onPressed in the button should open another external app , is that possible in Flutter and how should I proceed?

CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
  • 1
    Does this answer your question? [Launch an app from within another (iPhone)](https://stackoverflow.com/questions/419119/launch-an-app-from-within-another-iphone) – Ferdz Nov 13 '19 at 16:22

2 Answers2

2

You can use Column/Row to create your buttons. And after that you can simply use a RaisedButton like this:

ElevatedButton(
  onPressed: () {
    // use android_intent package to open other app
    final intent = AndroidIntent(package: "com.android.facebook", action: "action_view");
    intent.launch();
  },
  child: Text("Open Facebook")
)

It's easy to do it in Android using android_intent_plus and for iOS you can do it natively, this will help you.

CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
0

In my case action: "action_view" caused app selection dialog getting opened. We can open specific component using below.

You can try android_intent library for launching external app. Documentation has some sample codes. You may use sample code below.

var map={"AuthParams":authParam};
var intent=AndroidIntent(package:"in.app",arguments: map,componentName: "in.app.ui.splash.SplashActivity",/*action: "action_view"*/);
await intent.launch();