airplane_mode_detection 1.0.0 copy "airplane_mode_detection: ^1.0.0" to clipboard
airplane_mode_detection: ^1.0.0 copied to clipboard

Flutter plugin that allows you to detect and check mobile airplane mode callback functions on iOS and Android.

airplane_mode_detection #


A Flutter Plugin for Detecting the Airplane Mode in Android and iOS

Usage #


Use the plugin

Add the following import to your Dart code:

import 'package:airplane_mode_detection/airplane_mode_detection.dart';
import 'package:fluttertoast/fluttertoast.dart';
copied to clipboard

In order to detect the airplane mode, use AirplaneModeDetection.detectAirplaneMode() as below.
You will get the return value 'ON' or 'OFF'.

String state = await AirplaneModeDetection.detectAirplaneMode();
copied to clipboard

  static Future<String> detectAirplaneMode() async {
    final String airplanemode = await _channel.invokeMethod('detectAirplaneMode');
    return airplanemode;
  }
copied to clipboard

iOS available #

iOS is available from version 12

@available(iOS 12.0, *)
public class SwiftAirplaneModeDetectionPlugin: NSObject, FlutterPlugin {
  public static func register(with registrar: FlutterPluginRegistrar) {
    let channel = FlutterMethodChannel(name: "airplane_mode_detection", binaryMessenger: registrar.messenger())
    let instance = SwiftAirplaneModeDetectionPlugin()
    registrar.addMethodCallDelegate(instance, channel: channel)
  }
copied to clipboard

ScreenShots #

iOS #

IMG_8678 IMG_8680


Example #

Find the example wiring in the example app


API details #

See the airplane_mode_detection.dart for more API details.


Issues and feedback #

Please file issues to send feedback or report a bug. Thank you!

#


License #

MIT License

4
likes
40
points
32
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.16 - 2025.03.31

Flutter plugin that allows you to detect and check mobile airplane mode callback functions on iOS and Android.

Repository (GitHub)

License

MIT (license)

Dependencies

flutter, fluttertoast

More

Packages that depend on airplane_mode_detection