open_settings 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 84

open_settings #

pub package

The most complete flutter plugin packages for open various settings screen in Android and Ios #

For Android:<br/>

this plugin currently support jumping to WiFi, Mobile Data, Bluetooth ,Location, App Setting And Notification setting.<br/> Other setting path will be added soon.<br/> <br/>

For iOS:<br/>

this plugin only opens the app setting screen Settings application, as using url schemes to open inner setting path is a violation of Apple's regulations. Using url scheme to open settings can also leads to possible App Store rejection. <br/> <br/> <br/>

If you can find any workaround or enhancement, pull requests are always welcome. #

<br/>

Usage #

To use this plugin, add open_settings as a dependency in your pubspec.yaml file.

For iOS, It will always go to app setting.

Example #

import 'package:flutter/material.dart';
import 'package:open_settings/open_settings.dart';

void main() => runApp(MaterialApp(
      home: Scaffold(
        body: Center(
          child: RaisedButton(
            onPressed: () {
                OpenSettings.openWIFISetting();
              },
            child: Text('Wi-fi Settings'),
          ),
        ),
      ),
    ));

open_settings 1.0.2 #

Add openMainSetting() and openDateSetting() and openDisplaySetting() to access platform specific 'main setting' , 'date setting' , 'display setting' settings menu. <br/>

open_settings 1.0.1 #

Add openSoundSetting() to access platform specific 'sound' settings menu. <br/>

open_settings 1.0.0 #

Add openSecuritySetting() to access platform specific 'security' settings menu. <br/>

open_settings 0.0.1 #

Platform Specifics #

The following setting options available on both iOS and Android:<br/> openWIFISetting, <br/> openMobileDataSetting, <br/> openLocationSetting, <br/> openAppSetting, <br/> openBluetoothSetting, <br/> openNotificationSetting.<br/>

iOS #

All of the above options open the current 'app' settings section if there are settings defined. If no current settings are defined for the app the iPhone Settings Screen will be displayed.

Android #

All of the above options will open and display the corresponding screen:<br/> WIFI, <br/> Mobile Data, <br/> Location,<br/> App Setting, <br/> Bluetooth, <br/> Notification. <br/>

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:open_settings/open_settings.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Open Setting',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: new Center(
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new RaisedButton(
              onPressed: () {
                OpenSettings.openWIFISetting();
              },
              child: new Center(
                child: new Text('Wi-fi'),
              ),
            ),
            new SizedBox(
              height: 15,
            ),
            new RaisedButton(
              onPressed: () {
                OpenSettings.openMobileDataSetting();
              },
              child: new Center(
                child: new Text('Mobile Data'),
              ),
            ),
            new SizedBox(
              height: 15,
            ),
            new RaisedButton(
              onPressed: () {
                OpenSettings.openNotificationSetting();
              },
              child: new Center(
                child: new Text('Notification'),
              ),
            ),
            new SizedBox(
              height: 15,
            ),
            new RaisedButton(
              onPressed: () {
                OpenSettings.openBluetoothSetting();
              },
              child: new Center(
                child: new Text('Bluetooth'),
              ),
            ),
            new SizedBox(
              height: 15,
            ),
            new RaisedButton(
              onPressed: () {
                OpenSettings.openAppSetting();
              },
              child: new Center(
                child: new Text('App Setting'),
              ),
            ),
            new SizedBox(
              height: 15,
            ),
            new RaisedButton(
              onPressed: () {
                OpenSettings.openLocationSetting();
              },
              child: new Center(
                child: new Text('Location'),
              ),
            ),
            new SizedBox(
              height: 15,
            ),
            new RaisedButton(
              onPressed: () {
                OpenSettings.openDisplaySetting();
              },
              child: new Center(
                child: new Text('Security'),
              ),
            ),
            new SizedBox(
              height: 15,
            ),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  open_settings: ^1.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:open_settings/open_settings.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
69
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/open_settings.dart.

Run flutter format to format lib/open_settings.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test