user2402497
user2402497

Reputation: 31

How to handle incoming intents from external applications in Flutter

Some services vary between Android and iPhone, for example floating widget, widget on the home screen, can I make them using flutter

Can I view a dialog on the home screen like this example?

enter image description here

update thank everyone answer, but I need how to get it in Flutter

Upvotes: 1

Views: 462

Answers (2)

Akshay Khajuria
Akshay Khajuria

Reputation: 123

Yes you can show that

 new AlertDialog.Builder(YourActivity.this)
                                .setTitle("Alert")
                                .setMessage("Alert Message")
                                .setCancelable(false)
                                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                                    @Override
                                    public void onClick(DialogInterface dialog, int which) {
                                        //Here you can do whatever you want to do on click 
                                    }
                                }).show();

Upvotes: 1

CopsOnRoad
CopsOnRoad

Reputation: 267404

Sorry you can't do it in iOS, however in Android, you can, all you need to do is write platform specific code.

You could create an Activity with the Theme.Dialog theme. In your AndroidManifest.xml file add the theme to the activity, like this:

<activity android:name=".DialogActivity" android:theme="@android:style/Theme.Dialog"></activity>

From your service simply start this Activity. You will have to start the activity with the Intent.FLAG_ACTIVITY_NEW_TASK flag. See How to start an Activity from a Service

Source

Upvotes: 0

Related Questions