パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v2.0.1

wifi_configuration

Flutter Wifi プラグイン。

30日間ダウンロード
317
いいね数
25
Pub ポイント
150

パッケージをインストール

flutter pub add wifi_configuration

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Androidデバイス上のWi-Fiネットワークの構成および管理を可能にするFlutterプラグインです。ユーザーはプログラム的にWi-Fiネットワークに接続・切断し、利用可能なWi-Fiネットワークの一覧を表示できます。このプラグインは、ネットワーク設定ユーティリティやIoTデバイスの設定ツールなど、デバイスのWi-Fi設定と直接やり取りが必要なアプリ向けに設計されています。ネイティブなAndroid APIを使用して信頼性の高い接続制御を提供します。現在はAndroidのみ対応しており、iOS実装は未対応です。

用途

  • IoTデバイスのWi-Fi設定
  • ネットワーク接続の自動化
  • ゲストネットワークの設定
  • キオスクにおけるデバイス接続の管理
  • セルフサービスネットワーク設定の有効化

主な機能

  • Wi-Fiネットワークに接続する
  • 利用可能なWi-Fiネットワークを一覧表示
  • Wi-Fiから切断する
  • Android専用のサポート
  • ネットワーク管理のためのシンプルな API

適している対象

  • IoTデバイス設定アプリ
  • キオスクアプリケーション
  • ネットワーク自動化ツール
  • エンタープライズデバイス管理
  • モバイル構成ユーティリティ

注意事項

  • Androidプラットフォームに限定
  • 実行時権限が必要です
  • 接続にユーザーの確認が必要になる場合があります
  • iOS 対応なし
  • デバイスメーカーの実装に依存します

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

wifi_configuration

Connect a Flutter app to a Wi-Fi network, read the current SSID, and list available networks on Android and iOS.

This is a Dart 3 rewrite of wifi_configuration 1.2.1. The Dart API is the same (connectToWifi, getWifiList, isConnectedToWifi, connectedToWifi).

Install

dependencies:
  wifi_configuration: ^2.0.0

Usage

import 'package:wifi_configuration/wifi_configuration.dart';

final WifiConnectionStatus status = await WifiConfiguration.connectToWifi(
  'OfficeNet',
  'passphrase',
);

switch (status) {
  case WifiConnectionStatus.connected:
  case WifiConnectionStatus.alreadyConnected:
    break;
  case WifiConnectionStatus.locationNotAllowed:
    // Ask the user to enable location / grant permission.
    break;
  default:
    break;
}

final List<String> nearby = await WifiConfiguration.getWifiList();
final String current = await WifiConfiguration.connectedToWifi();
final bool matches = await WifiConfiguration.isConnectedToWifi('OfficeNet');

packageName from 1.x is still accepted as an optional third argument and is ignored on current Android/iOS.

Platform notes

Android

Add nothing extra in most apps — the plugin manifest already requests:

  • ACCESS_FINE_LOCATION / ACCESS_COARSE_LOCATION
  • NEARBY_WIFI_DEVICES (Android 13+)
  • Wi-Fi and network state permissions

Location must be on. On Android 10+ the OS shows a system dialog to join the network (WifiNetworkSpecifier). That join is app-scoped and may not appear as a saved system network.

iOS

In Xcode, enable:

  1. Hotspot Configuration
  2. Access Wi-Fi Information
  3. Link NetworkExtension.framework

And in Info.plist:

<key>NSLocationWhenInUseUsageDescription</key>
<string>Location is used to read the current Wi-Fi name and join a network.</string>

Apple does not allow scanning nearby Wi-Fi. getWifiList() returns SSIDs this app has configured, not every hotspot in range.

Status values

Value Meaning
connected Joined the requested SSID
alreadyConnected Already on that SSID
notConnected Join failed or was cancelled
platformNotSupported OS version cannot configure Wi-Fi
profileAlreadyInstalled iOS already has a profile for this SSID
locationNotAllowed Location permission or services denied

Example

See the example/ app for a small UI that lists networks, shows the current SSID, and connects with a passphrase.

カテゴリー

依存関係

依存関係一覧 1 件

  • plugin_platform_interface^2.0.2

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。