如何使用Flutter跳至移动设置

时间:2019-06-01 20:39:04

标签: flutter dart

如何使用Flutter跳至手机设置? 我使用了系统设置和appsettings程序包,但无法访问移动互联网等部分 请帮助我!

1 个答案:

答案 0 :(得分:0)

您可以使用 access_settings_menu 软件包here打开设置。

*来自软件包docs:

import 'package:access_settings_menu/access_settings_menu.dart';

// create an async void to call the API function with settings name as parameter
openSettingsMenu(settingsName) async {
    var resultSettingsOpening = false;

    try {
      resultSettingsOpening =
          await AccessSettingsMenu.openSettings(settingsType: settingsName);
    } catch (e) {
      resultSettingsOpening = false;
    }
}

//call the function to open the wireless settings Android menu

openSettingsMenu("ACTION_WIRELESS_SETTINGS");```