Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open device setting form flutter app?

I want to open the setting when the user taps the button.

I can see the intent Settings.ACTION_SETTINGS defined for the setting here

I am using the package Android_intent

code:

AndroidIntent intent = AndroidIntent(
   action: 'Settings.ACTION_SETTINGS',
 );
await intent.launch();

But, I am getting the error:-

E/flutter (14266): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, No Activity found to handle Intent { act=Settings.ACTION_SETTINGS (has extras) }, null)

How to open the setting page form flutter?

like image 756
rahul Kushwaha Avatar asked Mar 01 '26 06:03

rahul Kushwaha


1 Answers

I was using the wrong Setting intent, following is working code:-

AndroidIntent intent = AndroidIntent(
  action: 'android.settings.SETTINGS',
);
await intent.launch();
like image 175
rahul Kushwaha Avatar answered Mar 03 '26 19:03

rahul Kushwaha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!