fluttertpc_app_settings:基于 Flutter 的应用设置调起插件项目

用户可通过该项目实现在应用内打开 iOS 和 Android 手机设置。它是一个 Flutter 插件,支持指定设置类型打开,不支持时默认打开通用设置,Android 还可在不同 Activity 打开及使用设置面板。【此简介由AI生成】

Branch2Tags3

app_settings

pub package

A Flutter plugin for opening iOS and Android phone settings from an app.

Installation

First, add app_settings as a dependency in your pubspec.yaml file.

flutter pub add app_settings

Next, import 'app_settings.dart' into your dart code.

import 'package:app_settings/app_settings.dart';

iOS

TIP: If using Objective-C for iOS in your project, you will need to add use_frameworks! to your Runner project podfile in order to use this Swift plugin:

target 'Runner' do
  use_frameworks!

Usage

Open the settings of the application using AppSettings.openAppSettings(). By default, AppSettingsType.settings is used as the type, which opens the general application settings. If the given type is not supported on the current platform, the general settings are opened instead.

Android If asAnotherTask is set to true, the settings page is opened in a different Activity.

Widget build(BuildContext context) {
  return ElevatedButton(
    onPressed: () => AppSettings.openAppSettings(type: AppSettingsType.location),
    child: const Text('Open Location Settings'),
  );
}

Android Q Settings Panels

To open a Settings Panel on Android Q and higher, call AppSettings.openAppSettingsPanel() with a given type.

Widget build(BuildContext context) {
  return ElevatedButton(
    onPressed: () => AppSettings.openAppSettingsPanel(AppSettingsPanelType.volume),
    child: const Text('Open Volume Settings Panel'),
  );
}

Settings panels are not supported on other platforms.

Ohos Documentation

中文

EN

Introduction

用户可通过该项目实现在应用内打开 iOS 和 Android 手机设置。它是一个 Flutter 插件,支持指定设置类型打开,不支持时默认打开通用设置,Android 还可在不同 Activity 打开及使用设置面板。【此简介由AI生成】

Customize your domain