Buscar pacotes, repositórios e categorias de apps

Detalhes do pacotev0.1.7

bluetooth_enable_fork

Plugin Flutter para ligar o Bluetooth dentro do aplicativo

AndroidiOS
Downloads em 30 dias
967
Curtidas
20
Pontos Pub
140

Instalar pacote

flutter pub add bluetooth_enable_fork

Visão geral do pacote

Orientação gerada a partir de informações públicas. Apenas para referência.

Um plugin Flutter que permite o Bluetooth diretamente dentro de um aplicativo no Android e iOS. Ele fornece uma interface simples para verificar o status do Bluetooth e solicitar ativação, ajudando os aplicativos a orientar os usuários na ativação do Bluetooth quando necessário. Projetado como um fork do pacote original bluetooth_enable, mantém compatibilidade enquanto oferece possíveis melhorias ou correções. Ideal para aplicações que dependem da conectividade Bluetooth, como beacons, dispositivos IoT ou serviços baseados em NFC.

Casos de uso

  • Ativar o Bluetooth em aplicativos de IoT
  • Guiando usuários para ligar o Bluetooth
  • Integração com detecção de beacon
  • Suporte a NFC e funcionalidades de proximidade
  • Gerenciando permissões de Bluetooth em aplicativos

Principais recursos

  • Suporte multiplataforma (Android e iOS)
  • API simples para verificar e habilitar o Bluetooth
  • Gerenciamento de permissões amigável ao usuário
  • Fork com correções potenciais de bugs
  • Leve e fácil de integrar

Indicado para

  • Desenvolvedores construindo aplicativos dependentes do Bluetooth
  • Aplicativos que exigem configuração de Bluetooth guiada pelo usuário
  • Soluções baseadas em IoT e beacon
  • Aplicativos móveis que precisam de gerenciamento confiável do estado do Bluetooth
  • Projetos usando o pacote bluetooth_enable original

Considerações

  • Requer interação do usuário para habilitar o Bluetooth
  • Limitado ao controle básico do estado Bluetooth
  • Pode ser necessário permissões adicionais em algumas plataformas
  • Depende da implementação de Bluetooth do sistema operacional subjacente
  • Não adequado para operações de Bluetooth em segundo plano

README original

Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.

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).

Categorias

Repositório-fonte

Projetos que usam este pacote

Ainda não há dados.