Pakete, Repositories und App-Kategorien suchen

Paketdetailsv0.1.7

bluetooth_enable_fork

Flutter-Plugin zum Aktivieren von Bluetooth innerhalb der App

AndroidiOS
30-Tage-Downloads
967
Likes
20
Pub-Punkte
140

Paket installieren

flutter pub add bluetooth_enable_fork

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Ein Flutter-Plugin, das Bluetooth direkt innerhalb einer App auf Android und iOS ermöglicht. Es bietet eine einfache Schnittstelle zum Überprüfen des Bluetooth-Status und zum Anfordern der Aktivierung, wodurch Apps Benutzer bei der Aktivierung von Bluetooth unterstützen können, wenn dies erforderlich ist. Als Fork des ursprünglichen bluetooth_enable-Pakets konzipiert, behält es Kompatibilität bei und bietet möglicherweise Verbesserungen oder Fehlerbehebungen. Ideal für Anwendungen, die auf Bluetooth-Konnektivität angewiesen sind, wie Beacons, IoT-Geräte oder NFC-basierte Dienste.

Anwendungsfälle

  • Bluetooth in IoT-Anwendungen aktivieren
  • Benutzer anleiten, Bluetooth einzuschalten
  • Integration mit Beacon-Erkennung
  • Unterstützung von NFC und Nahfeldfunktionen
  • Bluetooth-Berechtigungen in Apps verwalten

Hauptmerkmale

  • Plattformübergreifende Unterstützung (Android & iOS)
  • Einfache API zum Überprüfen und Aktivieren von Bluetooth
  • Benutzerfreundliche Berechtigungsverwaltung
  • Fork mit möglichen Fehlerbehebungen
  • Leicht und einfach zu integrieren

Geeignet für

  • Entwickler, die Bluetooth-abhängige Apps erstellen
  • Apps, die eine benutzergeleitete Bluetooth-Einrichtung erfordern
  • IoT- und Beacon-basierte Lösungen
  • Mobile Apps, die eine zuverlässige Bluetooth-Zustandsverwaltung benötigen
  • Projekte, die das ursprüngliche bluetooth_enable-Paket verwenden

Hinweise

  • Benutzerinteraktion erforderlich, um Bluetooth zu aktivieren
  • Beschränkt auf grundlegende Bluetooth-Statussteuerung
  • Auf einigen Plattformen sind möglicherweise zusätzliche Berechtigungen erforderlich
  • Abhängig von der zugrundeliegenden OS-Bluetooth-Implementierung
  • Nicht geeignet für Hintergrund-Bluetooth-Operationen

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

Introduction

BluetoothEnable is a Bluetooth plugin for Flutter, to programtically request turning on Bluetooth within applications.

This plugin was created with the intention to allow developers to customise their own application workflow on when permissions are requested.

Usage

Enable Bluetooth
import 'package:bluetooth_enable_fork/bluetooth_enable.dart';

// Request to turn on Bluetooth within an app
BluetoothEnable.enableBluetooth.then((result) {
  if (result == "true") {
    // Bluetooth has been enabled
  }
  else if (result == "false") {
    // Bluetooth has not been enabled
  }
});
Enable Bluetooth with Custom Alert

This method calls an alert from Dart level. Depending on the user's selection, Bluetooth will either be manually turned on without an additional dialog request or nothing happens.

Parameter Description
context The material context of your current content
dialogTitle The title of the dialog is displayed in a large font at the top
displayDialogContent Enable or disable showing dialog content
dialogContent The content of the dialog that is displayed in the center
cancelBtnText The cancel button text of the dialog (left button)
acceptBtnText The accept button text of the dialog (right button)
dialogRadius The border radius of dialog
barrierDismissible Enable or Disable whether dialog is dismissible on external click
import  'package:bluetooth_enable_fork/bluetooth_enable.dart';

Future<void> customEnableBT(BuildContext context) async {
  String dialogTitle = "Hey! Please give me permission to use Bluetooth!";
  bool displayDialogContent = true;
  String dialogContent = "This app requires Bluetooth to connect to device.";
  //or
  // bool displayDialogContent = false;
  // String dialogContent = "";
  String cancelBtnText = "Nope";
  String acceptBtnText = "Sure";
  double dialogRadius = 10.0;
  bool barrierDismissible = true; //

  BluetoothEnable.customBluetoothRequest(context, dialogTitle, displayDialogContent, dialogContent, cancelBtnText, acceptBtnText, dialogRadius, barrierDismissible).then((result) {
    if (result == "true") {
      //Bluetooth has been enabled
    }
  });
}
iOS support

If Bluetooth has not been activated, a popup window will appear on enableBluetooth call asking user to activate Bluetooth in the application settings; the method will immediately return false (but will return true on next call if user enabled Bluetooth in the meantime).

Kategorien

Quell-Repository

Projekte, die dieses Paket verwenden

Noch keine Daten verfügbar.