dartpub.dev DartNative · beta
plugins / app_settings_kit
ap

app_settings_kit

v0.1.0 MIT

Open your app's OS settings pages on iOS and Android over FFI.

Open the OS settings pages for your app from DartNative apps on iOS and Android, over FFI with no permissions. Covers the app's own page, notifications, location, Wi-Fi, Bluetooth, display, sound, battery, security and the Settings home.

by saitojo1106/app_settings_kit · DartNative ≥ 3.0 · updated 5 days ago
Install
Free
pubspec.yaml
dependencies:
  app_settings_kit:
    hosted: https://dartpub.dev
    version: ^0.1.0
Weekly installs
0
Active apps
0
Rating
0.0 · 0
Open issues
0

app_settings_kit

Open the OS settings screens from DartNative apps on iOS and Android, the DartNative counterpart of Flutter's app_settings.

  • One call, AppSettings.open(page), takes the user to the app's own settings, notification settings, location, Wi-Fi, Bluetooth, display, sound, battery, security, or the system settings root.
  • Implemented over FFI in a single native round trip: UIApplication.open on iOS, Settings.ACTION_* intents on Android.
  • No extra permissions, no callbacks, no platform channels.

Install

app_settings_kit is published on dartpub.dev. Add a plain version dependency to your app's pubspec.yaml; it resolves the same way the DartNative framework itself does:

dependencies:
  app_settings_kit: ^0.1.0

Then fetch it with:

dn pub get

The generated dartnative_plugin_registrant.dart loads the FFI symbols; call DartNativePluginRegistrant.registerAll() in main() as usual. Android requires minSdk 26 or higher; iOS requires iOS 15 or higher.

Usage

import 'package:app_settings_kit/app_settings_kit.dart';

// The app's own settings page (permissions, notifications, storage, ...).
final opened = await AppSettings.open();

// A specific page. On iOS every page other than `app` and `notifications`
// falls back to the app's settings page.
await AppSettings.open(AppSettingsPage.location);

Public API

Member Description
AppSettings.open([page]) Future<bool>. Opens page (default AppSettingsPage.app). true when the OS accepted the request, false when nothing could be opened.
AppSettingsPage app, notifications, location, wifi, bluetooth, display, sound, battery, security, system.

The enum order is the native ABI: page.index is passed to int32_t DNAppSettingsOpen(int32_t page), which returns 1 or 0.

Platform notes

iOS only exposes two public settings URLs, so:

Page Opens
app The app's page in Settings (UIApplication.openSettingsURLString).
notifications The app's notification settings on iOS 16+ (UIApplication.openNotificationSettingsURLString); the app's settings page on iOS 15.
everything else The app's settings page. open still returns true if that opened.

Private App-Prefs: URL schemes are deliberately not used; they are rejected by App Store review. The call is executed on the main thread even from a background isolate.

Android starts an Activity from the application context with FLAG_ACTIVITY_NEW_TASK:

Page Intent
app ACTION_APPLICATION_DETAILS_SETTINGS with package:<applicationId>
notifications ACTION_APP_NOTIFICATION_SETTINGS with EXTRA_APP_PACKAGE
location ACTION_LOCATION_SOURCE_SETTINGS
wifi ACTION_WIFI_SETTINGS
bluetooth ACTION_BLUETOOTH_SETTINGS
display ACTION_DISPLAY_SETTINGS
sound ACTION_SOUND_SETTINGS
battery ACTION_BATTERY_SAVER_SETTINGS
security ACTION_SECURITY_SETTINGS
system ACTION_SETTINGS

If the device has no Activity for the requested action, the plugin opens ACTION_SETTINGS instead. Any exception while starting the Activity yields false.

How it works

Read in this order:

  1. lib/src/app_settings.dart – public API and the AppSettingsPage enum
  2. lib/src/app_settings_ffi_bindings.dart – Dart side of the FFI call
  3. ios/Classes/DNAppSettings.swift – iOS implementation
  4. android/src/main/kotlin/io/github/saitojo1106/app_settings_kit/DNAppSettingsBridge.kt – Android implementation
  5. android/src/main/cpp/dn_app_settings.cpp – JNI glue between Dart and Kotlin

Example

example/ is a dn create app that depends on this plugin via path: ../.

cd example
dn pub get
dn run -d <device-id>

The screen lists one button per AppSettingsPage and shows the bool each call returned.

Tested on

Platform Device Result
Android 16 Pixel 8a All ten pages open the matching Settings screen (app opens the app's details page, security opens Safety Center, system opens the Settings home).
iOS 18.7 iPhone 16e app opens the app's page in Settings and notifications opens its notification settings.

Verified 2026-09-16 with DartNative SDK 3.45.0. dart test and dart analyze pass for the plugin and the example.

License

MIT. See LICENSE.