If you want to open location setting by flutter using android_intent You can use do it without additional dependencies like android_intent or url_launcher.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
class MainActivity : FlutterActivity() { companion object { private const val CHANNEL = "com.myapp/intent" const val MAP_METHOD = "settings" } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) GeneratedPluginRegistrant.registerWith(this) MethodChannel(flutterView, CHANNEL).setMethodCallHandler { call, result -> if (call.method == MAP_METHOD) { startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)) result.success(null) } else { result.notImplemented() } } } } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.