搜尋套件、儲存庫與 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

原始碼儲存庫

使用此套件的專案

所在榜單