패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.1.7

bluetooth_enable_fork

앱 내에서 블루투스를 켜는 Flutter 플러그인

AndroidiOS
30일 다운로드
967
좋아요
20
Pub 점수
140

패키지 설치

flutter pub add bluetooth_enable_fork

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

안드로이드 및 iOS 앱 내에서 직접 블루투스를 활성화할 수 있는 플러터 플러그인입니다. 블루투스 상태를 확인하고 활성화를 요청하는 간단한 인터페이스를 제공하여 필요 시 사용자가 블루투스를 켜도록 안내합니다. 원래의 bluetooth_enable 패키지의 포크로, 호환성을 유지하면서 개선 사항이나 수정 사항을 제공합니다. 비콘, IoT 장치 또는 NFC 기반 서비스와 같은 블루투스 연결에 의존하는 애플리케이션에 적합합니다.

사용 사례

  • IoT 앱에서 블루투스 활성화
  • 사용자가 블루투스를 켜도록 안내하기
  • 비콘 탐지와의 통합
  • NFC 및 근접 기능 지원
  • 앱에서 블루투스 권한 처리

주요 기능

  • 크로스 플랫폼 지원 (Android 및 iOS)
  • 블루투스 확인 및 활성화를 위한 간단한 API
  • 사용자 친화적인 권한 처리
  • 잠재적 버그 수정이 포함된 포크
  • 경량이며 통합이 쉬움

적합한 대상

  • 블루투스에 의존하는 앱을 개발하는 개발자
  • 사용자 안내 블루투스 설정이 필요한 앱
  • 사물인터넷 및 비콘 기반 솔루션
  • 신뢰할 수 있는 블루투스 상태 관리가 필요한 모바일 앱
  • 원본 bluetooth_enable 패키지를 사용하는 프로젝트

고려 사항

  • 블루투스를 활성화하려면 사용자 상호작용이 필요합니다
  • 기본 블루투스 상태 제어에 제한됨
  • 일부 플랫폼에서는 추가 권한이 필요할 수 있습니다
  • 기반 운영 체제 블루투스 구현에 따라 다릅니다
  • 백그라운드 블루투스 작업에 적합하지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

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

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.