Giter Site home page Giter Site logo

wifi's People

Contributors

aryzhov avatar fourleaftec avatar once10301 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wifi's Issues

Android app crashes after permission request popup

Android app crashes first time request permission when launching, on both deny and grant action. The app restarts, it works fine then.

E/AndroidRuntime(11564): FATAL EXCEPTION: main
E/AndroidRuntime(11564): Process: br.com.etereo.app, PID: 11564
E/AndroidRuntime(11564): java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=1, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {br.com.etereo.app/br.com.etereo.app.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object io.flutter.plugin.common.MethodCall.argument(java.lang.String)' on a null object reference
E/AndroidRuntime(11564): at android.app.ActivityThread.deliverResults(ActivityThread.java:4845)
E/AndroidRuntime(11564): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)
E/AndroidRuntime(11564): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(11564): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(11564): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(11564): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
E/AndroidRuntime(11564): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(11564): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(11564): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(11564): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11564): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(11564): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime(11564): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object io.flutter.plugin.common.MethodCall.argument(java.lang.String)' on a null object reference
E/AndroidRuntime(11564): at com.ly.wifi.WifiDelegate.launchWifiList(WifiDelegate.java:180)
E/AndroidRuntime(11564): at com.ly.wifi.WifiDelegate.onRequestPermissionsResult(WifiDelegate.java:300)
E/AndroidRuntime(11564): at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onRequestPermissionsResult(FlutterEnginePluginRegistry.java:612)
E/AndroidRuntime(11564): at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onRequestPermissionsResult(FlutterEnginePluginRegistry.java:356)
E/AndroidRuntime(11564): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onRequestPermissionsResult(FlutterActivityAndFragmentDelegate.java:509)
E/AndroidRuntime(11564): at io.flutter.embedding.android.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:611)
E/AndroidRuntime(11564): at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8262)
E/AndroidRuntime(11564): at android.app.Activity.dispatchActivityResult(Activity.java:8112)
E/AndroidRuntime(11564): at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)
E/AndroidRuntime(11564): ... 11 more
I/Process (11564): Sending signal. PID: 11564 SIG: 9

wifi 0.1.5
Android 10

Cannot connect to a open network

I tied to connect to a network which has no security , I tried to send '' empty String but it showed WiFi state as error.But I can connect to a network which has security

List and get SSID Does Not Work

Hi
I am using ANDROID X
getting list is not working, it always returns []
getting SSID returns unknown SSID, and also level not showing anything
What Should I Do?

registerWith gives NPE when using Flutter's background execution on Android

Flutter's new background execution feature (described here: https://medium.com/flutter-io/executing-dart-in-the-background-with-flutter-plugins-and-geofencing-2b3e40a1a124) allows plugins to be registered in a background context (e.g. a Service). The problem is that the wifi plugin assumes that the context for plugin registration is an activity with this line of code:

WifiManager wifiManager = (WifiManager) registrar.activity().getApplicationContext().getSystemService(Context.WIFI_SERVICE);

registrar.activity() may now return null, and this leads to a NPE:

E/AndroidRuntime( 2453): 	at com.ly.wifi.WifiPlugin.registerWith(WifiPlugin.java:23)
E/AndroidRuntime( 2453): 	at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:30)

The solution is to change the above line of code to this:

WifiManager wifiManager = (WifiManager) registrar.activeContext().getApplicationContext().getSystemService(Context.WIFI_SERVICE);

Wifi.connection() returns success with bad arguments

I tried just the raw example which presumably should have failed;

var result = await Wifi.connection('ssid', 'password');
print(result);

The result was "WifiState.success". I had already been connected to a WiFi access point prior to the connection attempt. Are you reporting the result of the connect attempt or merely the current state?

Getting signal strength on iPhoneX emulator causes crash

This issue occurs on iPhoneX emulator and similar, but it works fine on other emulators such as iPhone7

Calling this

Future<Null> _getWifSignalStrength() async {
    int l = await Wifi.level;
    setState(() {
      _signalStrength = l;
    });
  }

Causes a crash and this stack trace:

*** First throw call stack:
(
	0   CoreFoundation                      0x000000010a8601bb __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x0000000109dfe735 objc_exception_throw + 48
	2   CoreFoundation                      0x000000010a85fd29 -[NSException raise] + 9
	3   Foundation                          0x000000010982acd9 -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 226
	4   Foundation                          0x0000000109829b21 -[NSObject(NSKeyValueCoding) valueForKey:] + 284
	5   Runner                              0x0000000107cec7e0 -[WifiPlugin getSignalStrength] + 176
	6   Runner                              0x0000000107cebfbb -[WifiPlugin handleMethodCall:result:] + 603
	7   Flutter                             0x0000000107fe97ba __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 115
	8   Flutter                             0x00000001080064ac _ZNK5shell21PlatformMessageRouter21HandlePlatformMessageEN3fml6RefPtrIN5blink15PlatformMessageEEE + 166
	9   Flutter                             0x0000000108009ff0 _ZN5shell15PlatformViewIOS21HandlePlatformMessageEN3fml6RefPtrIN5blink15PlatformMessageEEE + 38
	10  Flutter                             0x000000010805cca7 _ZNSt3__110__function6__funcIZN5shell5Shell29OnEngineHandlePlatformMessageEN3fml6RefPtrIN5blink15PlatformMessageEEEE4$_27NS_9allocatorIS9_EEFvvEEclEv + 57
	11  Flutter                             0x0000000108015e0e _ZN3fml15MessageLoopImpl15RunExpiredTasksEv + 522
	12  Flutter                             0x000000010801918c _ZN3fml17MessageLoopDarwin11OnTimerFireEP16__CFRunLoopTimerPS0_ + 26
	13  CoreFoundation                      0x000000010a7c5f34 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
	14  CoreFoundation                      0x000000010a7c5b32 __CFRunLoopDoTimer + 1026
	15  CoreFoundation                      0x000000010a7c539a __CFRunLoopDoTimers + 266
	16  CoreFoundation                      0x000000010a7bfa1c __CFRunLoopRun + 2252
	17  CoreFoundation                      0x000000010a7bee11 CFRunLoopRunSpecific + 625
	18  GraphicsServices                    0x000000010e9491dd GSEventRunModal + 62
	19  UIKitCore                           0x000000011537981d UIApplicationMain + 140
	20  Runner                              0x0000000107cebb70 main + 112
	21  libdyld.dylib                       0x000000010dbb7575 start + 1
	22  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

> > If you want a specific list of wifi devices follow as shown below:

If you want a specific list of wifi devices follow as shown below:

//Declare the list
List<WifiResult> ssidList = [];
List wifilist=new List();

_wifiList()async{
    Wifi.list('').then((list) {
      setState(() {
        ssidList = list.toSet().toList();
        for (var i = 0; i < ssidList.length; i++) {
          wifiList.add(ssidList[i].ssid.toString());
        }
      });
    });
}

thanks, it's worked.

I tried the same still I am getting an empty list.

Actually I am working on an IOT project in which I have to connect my IOT device to any Wifi and that's why I need a list of all available wifi list with SSID.

Originally posted by @DhavalRKansara in #24 (comment)

The plugin `wifi` uses a deprecated version of the Android embedding.

The plugin wifi uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

Please fix this! for new flutter this doesn't work

Flutter 2.5.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 3595343e20 (3 days ago) • 2021-09-30 12:58:18 -0700
Engine • revision 6ac856380f
Tools • Dart 2.14.3

plugin `wifi` uses a deprecated version of the Android embedding.

Please Update The plugin with this change. Thanks.!

plugin wifi uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

[Feature request] Delete Wifi AP when uninstall app

This may be due to the limitations of the OS platforms, but if possible, it would be nice to have an option to tell the OS to delete the Ap's created by the application so that they are deleted when the application is uninstalled.

For now when trying to create same AP after uninstall and reinstall, a specific error occur then i just show a message saying go to Settings > Wifi > forget it.

Can't connect to saved networks

I am not sure if this is intentional, but I am unable to connect to networks that have been saved to my device outside of the app. This would cause an issue for any user trying to connect to a network they have used before. Attempting to connect doesn't throw any errors, it just returns as WifiState.error.

Cannot list down Wifi ssid(s).

I tried to list down available wifi list, it's not working. and when I tried with debug console i didn't get any errors.
loadData() is not working.
void loadData() async {
await Wifi.list('').then((list) {
setState(() {
ssidList = list;
});
});
}

Android X compatibility

Hi. The current version does not seem to be compatible with Android X. Is there any update planned about getting compatible?

Error when importing

I have added this package to my yaml file and done packages get. But I get an error whenever I import it.

Target or URI doesn't exist: 'package:wifi/wifi.dart'

Flutter Doctor:
C:\Repo\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel beta, v1.3.8, on Microsoft Windows [Version 10.0.17763.379], locale en-GB)
• Flutter version 1.3.8 at C:\Repo\flutter
• Framework revision e5b1ed7a7f (5 weeks ago), 2019-03-06 14:23:37 -0800
• Engine revision f4951df193
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\Jason\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.

[√] Android Studio (version 3.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[!] VS Code (version 1.32.3)
• VS Code at C:\Users\Jason\AppData\Local\Programs\Microsoft VS Code
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (1 available)
• ONEPLUS A6013 • ef41f3a4 • android-arm64 • Android 9 (API 28)

! Doctor found issues in 1 category.
Process finished with exit code 0

exception on Wifi.list()

Trying to invoke some methods in this package and getting an exception on Wifi.list().

It calls this function;
static Future<T> list<T>(String key) async { final Map<String, dynamic> params = { 'key': key, }; return await _channel.invokeMethod('list', params); }

...and an uncaught exception is thrown;
type 'List' is not a subtype of type 'FutureOr<List>'

Don't connect to any WIFI

I can list the available WIFI, but i cant connect to any red, the first time that press the Connection button, the app didn't do anything, flutter don't show error, but the second time that the Connection button is pressed i get this exception "PlatformException (PlatformException(already_active, wifi is already active, null))", but the wifi is not active and is not connected. That happen with all wifi that i try to connect, in Android 9.

It works only if I am connected to a wifi network, and I connect to another, but if I am not connected to any network, it does not work.

[Android] Can not connect to wifi already connect before.

Step1: Open android wifi system setting, connect to wifi A and leaver (not forget)
Step2: Open app and connect to wifi A, function wifiManager.addNetwork(wifiConfig); alway return -1

If I forget wifi A and go to app connect then it will connect success.

If wifi A already connect before, in Android 8 and below wifiManager.getConfiguredNetworks() can return this wifi A so I can get netId to enable but in Android 10 is not return anything, Android 9 not tested because I don't have.

Any idea?

Failed to connect to existing saved wifi network

Using the same line of code

...
var result = await Wifi.connection('ssid', 'password');
...

First launch of app successfully connects.
Subsequently, it does not and returns error

Failed to handle method call
E/MethodChannel#plugins.ly.com/wifi(12914): java.lang.IllegalStateException: Reply already submitted
E/MethodChannel#plugins.ly.com/wifi(12914):     at io.flutter.view.FlutterNativeView$1.reply(FlutterNativeView.java:174)
E/MethodChannel#plugins.ly.com/wifi(12914):     at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:199)
E/MethodChannel#plugins.ly.com/wifi(12914):     at com.ly.wifi.WifiDelegate.finishWithError(WifiDelegate.java:267)
E/MethodChannel#plugins.ly.com/wifi(12914):     at com.ly.wifi.WifiDelegate.finishWithAlreadyActiveError(WifiDelegate.java:263)
E/MethodChannel#plugins.ly.com/wifi(12914):     at com.ly.wifi.WifiDelegate.connection(WifiDelegate.java:167)
E/MethodChannel#plugins.ly.com/wifi(12914):     at com.ly.wifi.WifiPlugin.onMethodCall(WifiPlugin.java:47)
E/MethodChannel#plugins.ly.com/wifi(12914):     at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)
E/MethodChannel#plugins.ly.com/wifi(12914):     at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:163)
E/MethodChannel#plugins.ly.com/wifi(12914):     at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.ly.com/wifi(12914):     at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#plugins.ly.com/wifi(12914):     at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#plugins.ly.com/wifi(12914):     at android.app.ActivityThread.main(ActivityThread.java:6680)
E/MethodChannel#plugins.ly.com/wifi(12914):     at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.ly.com/wifi(12914):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#plugins.ly.com/wifi(12914):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Hence, does connection() handles reconnection to existing saved wifi network?

Can you add support for native dart

Currently this package support only flutter, I am using dart native/ console and in need of the same behavior that the package offers.

Can you transform the package to work without flutter?

Wifi.ip issue

When I am on mobile network and not connected to WiFi
This line fails
final String ip = await Wifi.ip;
The following error I get:

E/MethodChannel#plugins.ly.com/wifi(25613): Failed to handle method call
E/MethodChannel#plugins.ly.com/wifi(25613): java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.success(java.lang.Object)' on a null object reference
E/MethodChannel#plugins.ly.com/wifi(25613): 	at com.ly.wifi.WifiDelegate.launchIP(WifiDelegate.java:141)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at com.ly.wifi.WifiDelegate.getIP(WifiDelegate.java:128)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at com.ly.wifi.WifiPlugin.onMethodCall(WifiPlugin.java:55)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at android.os.Looper.loop(Looper.java:174)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at android.app.ActivityThread.main(ActivityThread.java:7682)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
E/MethodChannel#plugins.ly.com/wifi(25613): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
E/DartMessenger(25613): Uncaught exception in binary message listener
E/DartMessenger(25613): java.lang.IllegalStateException: Reply already submitted
E/DartMessenger(25613): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:135)
E/DartMessenger(25613): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:240)
E/DartMessenger(25613): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/DartMessenger(25613): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
E/DartMessenger(25613): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/DartMessenger(25613): 	at android.os.MessageQueue.next(MessageQueue.java:336)
E/DartMessenger(25613): 	at android.os.Looper.loop(Looper.java:174)
E/DartMessenger(25613): 	at android.app.ActivityThread.main(ActivityThread.java:7682)
E/DartMessenger(25613): 	at java.lang.reflect.Method.invoke(Native Method)
E/DartMessenger(25613): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
E/DartMessenger(25613): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Reloaded 1 of 566 libraries in 432ms.
I/flutter (25613): Finish. Found 0 device(s)

Flutter Doctor result

[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 10.0.18363.592], locale en-IN)
    • Flutter version 1.7.8+hotfix.3 at C:\flutter
    • Framework revision b712a172f9 (7 months ago), 2019-07-09 13:14:38 -0700
    • Engine revision 54ad777fd2
    • Dart version 2.4.0

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\Ashish\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = C:\Users\Ashish\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code, 64-bit edition (version 1.41.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.7.1

[√] Connected device (1 available)
    • GM1911 • bdf409c6 • android-arm64 • Android 10 (API 29)

android x

Android dependency 'androidx.core:core' has different version for the compile (1.1.0-alpha01) and runtime (1.1.0-rc02) classpath. You should manually set the same version via DependencyResolution

How Connect to a Wifi ?

Hello ,
I used this package to get list of wifi and and connect to one of that (which i set the password in my code and user by tapping that get connect ) .
I could get list of wifi but no idea about how can connect by clicking , Please share the example if anyone has , or share with me which method should I use for getting connect and how ?
Thanks

Reply already submitted

Happens after restarting the application when debugging.

E/MethodChannel#plugins.ly.com/wifi(29681): Failed to handle method call

E/MethodChannel#plugins.ly.com/wifi(29681): java.lang.IllegalStateException: Reply already submitted

E/MethodChannel#plugins.ly.com/wifi(29681): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:124)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:209)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at com.ly.wifi.WifiDelegate.finishWithError(WifiDelegate.java:267)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at com.ly.wifi.WifiDelegate.finishWithAlreadyActiveError(WifiDelegate.java:263)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at com.ly.wifi.WifiDelegate.getWifiList(WifiDelegate.java:136)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at com.ly.wifi.WifiPlugin.onMethodCall(WifiPlugin.java:44)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:88)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:219)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at android.os.MessageQueue.nativePollOnce(Native Method)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at android.os.MessageQueue.next(MessageQueue.java:326)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at android.os.Looper.loop(Looper.java:160)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at android.app.ActivityThread.main(ActivityThread.java:6718)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at java.lang.reflect.Method.invoke(Native Method)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

E/MethodChannel#plugins.ly.com/wifi(29681): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Not receiving updated wifi...

I am using Wifi.list('') but it is not updating scan wifi list accurately.

Suppose There are 3 wifis are there initially and I generate one wifi with mobile hotspot and then clicking on button when I call for again Wifi.list('') still I am getting old results with 3 wifi. Same out of 3 if I turn off any of wifi then still I get 3 wifis but If I open the default wifi setting of my phone and those wifi changes reflected over there and I requested with Wifi.list('') then I got the updated result.

Can you please provide me suggestion that how I can get the updated wifi results without opening the default wifi setting of my Mobile phone.

  • Code for getting wifi list:
  _wifiList() async {
    List<WifiResult> filteredList = [];
    bool match = true;

    Wifi.list('').then((list) {
      for (WifiResult result in list) {
        if (filteredList.isEmpty) {
          filteredList.add(result);
        } else {
          for (WifiResult fResult in filteredList) {
            if (result.ssid == fResult.ssid && match) {
              match = false;
            }
          }
          if (match) {
            filteredList.add(result);
          }
          match = true;
        }
      }

      for (WifiResult wifi in filteredList) {
        print("ssid ${wifi.ssid}");
      }
    });
  }
}

Keep the connection Wi-Fi without Internet access

I was using this package without disconnection but after reset my phone Android keep cuting the wifi connection without internet and reconnect to my wifi with Internet.
How to prevent that from this package or another?
I guess i can do that on some settings on my Android but il would like to do that programatically.

Is there any roadmap for ios?

I 'm working on ios version with this module but not working and no any error.
Please share what is roadmap in the future for ios.

Wifi package totally not working on my tablet

My tablet has an android version 10.

All features of the package are not usable by me.

image
image
As you can see in the console that wifi list is coming empty.

I am using Flutter 2.2.1

Compile and Target SDK version are 28

I have also tried versions 30 and 31.

It was working some months back but has suddenly stopped working. Please can you guide me on how to use the package in android 10.

On android 11 version, the package is working fine.

Thankyou.

Turning on WiFi

Hello,
Is there any way to detect if the "WiFi" is turned off and then turn on the WiFi programmatically? If required prompt a user permission for it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.