搜索插件、代码仓与 APP 分类

插件详情v9.0.1

app_settings

一个用于从应用程序中打开 iOS 和 Android 手机设置的 Flutter 插件。

AndroidiOSmacOS
近 30 天下载
91.1万
喜欢数
1250
Pub 分数
160

安装插件

flutter pub add app_settings

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

app_settings 包是一个 Flutter 插件,可让应用程序在 Android、iOS 和 macOS 上打开原生设备设置页面。它提供了一个简单的接口,可直接将用户导航到系统设置,例如蓝牙、Wi-Fi 或隐私权限。这通过减少调整设备配置时的摩擦来提升用户体验。该插件利用平台特定的 API,确保在支持的平台上具有兼容性和可靠性。

适合场景

  • 打开蓝牙设置
  • 导航到Wi-Fi设置
  • 重定向到隐私权限
  • 引导用户前往位置服务
  • 访问电池优化设置

主要特点

  • 跨平台支持(Android、iOS、macOS)
  • 用于打开系统设置的简单 API
  • 与设备设置的原生集成
  • 无需额外权限
  • 轻量且易于集成

适合对象

  • 需要设备配置访问权限的应用
  • 用户引导流程
  • 权限请求指南
  • 故障排除工具
  • 移动应用中的设置导航

使用建议

  • 需要用户交互才能打开设置
  • 限于预定义的系统设置
  • 不处理设置更改
  • 平台特定的行为可能有所不同
  • 如果设置不可用,则无反馈

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

app_settings

pub package

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

Features

  • Supports Swift Package Manager (SPM) for iOS integration.
  • Opens various settings pages (e.g., location, Wi-Fi, etc.) for both Android and iOS.

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!

If you prefer using Swift Package Manager (SPM), make sure to enable swift support in your project. See also Flutter SPM integration.

  flutter config --enable-swift-package-manager 

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.

所属分类

依赖

依赖清单 1 项

  • plugin_platform_interface^2.0.2

源码仓库

使用此插件的项目

所在榜单