Dart / Flutter package that allows discovering network devices in local network (LAN).

Overview

lan_scanner

Pub badge style: lint

Dart / Flutter package that allows discovering network devices in local network (LAN).

Note: This library is intended to be used on Class C networks.

This project is a rework of already existing ping_discover_network, however it is no longer maintained.

pub.dev page | API reference

Getting Started

Add the package to your pubspec.yaml:

lan_scanner: ^1.0.3

Import the library:

import 'package:lan_scanner/lan_scanner.dart';

Create an instance of the class and call quickScan() or preciseScan() on it:

final port = 80;
final subnet = "192.168.0";
final timeout = Duration(seconds: 5);

final scanner = LanScanner();

final stream = scanner.quickScan(
    subnet: _subnet,
    timeout: _timeout,
    progressCallback: (progress) {
    print(progress);
    });

stream.listen((DeviceAddress device) {
    if (device.exists) {
        print("Found device on ${device.ip}:${device.port}");
    }
    });

If you don't know what is your subnet, you can use network_info_plus and then ipToSubnet() function.

var wifiIP = await (NetworkInfo().getWifiIP())

var subnet = ipToSubnet(wifiIP);

Features and bugs

Please file feature requests and bugs at the issue tracker.

Open in Visual Studio Code

Comments
  • Missing permission in AndroidManifest.xml (release)

    Missing permission in AndroidManifest.xml (release)

    After adding the package to my project, it works fine except when trying to run it as a release version. The reason is the missing permission in the AndroidManifest.xml in the release folder, which took me a long time to figure out. Maybe there is a way to add the permission automatically so that future users of the library don't have to figure it out?

    bug 
    opened by DamnDaniel-98 4
  • Undefined name 'scanner'.

    Undefined name 'scanner'.

    final stream = scanner.icmpScan('192.168.0', progressCallback: (progress) {
        print('Progress: $progress');
    });
    
    stream.listen((HostModel device) {
        print("Found host: ${device.ip}");
    });
    
    lib/main.dart:146:18: Error: Undefined name 'scanner'.
      final stream = scanner.icmpScan('192.168.0', progressCallback: (progress) {
                     ^^^^^^^
    Failed to package /Users/jordandalton/StudioProjects/goldshell.
    Command PhaseScriptExecution failed with a nonzero exit code
    

    Could not build the application for the simulator. Error launching application on iPhone 13.

    documentation 
    opened by JordanDalton 3
  • iOS Support

    iOS Support

    Hi! I'm the author of the dart_ping package and I noticed you have a warning on your readme that states that your package does not support iOS. I also recall you opened an issue on my package about this and we were running into the same tradeoff where we either have ios support and depend on flutter and lose native dart support or we lose ios support to preserve native dart.

    I just wanted to chime in and say you can probably point your users towards my dart_ping_ios package since they should still be able to use this to enable your package on iOS without any changes to your package. They just need to import it and call the registration function. Granted, this will require the flutter sdk but at least then the choice is up to your users rather than you as an author.

    Just a friendly heads up in case it helps. Let me know if you have any questions about how that works. :)

    opened by point-source 4
  • What is the difference between lan_scanner and network_tools

    What is the difference between lan_scanner and network_tools

    I joined the work on network_tools before a couple of months and now I have found this package.

    If my test is correct the async searching that I have implemented there is faster for pinging IP but as I didn't look at the code here maybe this package doing staff differently or has more options.

    Can you check network_tools and tell me about the differences?, it is waste of time for all of us to build the same thing and maintain it separately.

    opened by guyluz11 1
  • Link to repo is missing in pub.dev

    Link to repo is missing in pub.dev

    Repository (GitHub) button exist in the right side:

    image

    Repository (GitHub) button is missing in the right side:

    image

    I saw that the Homepage button is linked to this repo but that functionality is more suited for Repository (GitHub) button.

    bug 
    opened by guyluz11 0
Releases(v2.0.1)
A Video and Audio player that can play from local assets, local files and network URLs with the powerful controls

Video/Audio Player in Flutter with Powerful controls How can we play videos in Flutter? There is a library directly from the Flutter team simply calle

Harsh Mistry 12 Jan 31, 2022
Dart package to support Wake-on-LAN functionality

wake_on_lan Dart library package to easily send Wake-on-LAN magic packets to devices on your local network. Getting Started wake_on_lan has three core

Jagandeep Brar 3 Oct 24, 2022
Dart package for Async Data Loading and Caching. Combine local (DB, cache) and network data simply and safely.

Stock is a dart package for loading data from both remote and local sources. It is inspired by the Store Kotlin library.

xmartlabs 59 Dec 24, 2022
A Dart/Flutter package to perform network calls. It uses Isolates to perform network calls on Dart VM environments and WebWorkers on Web.

ArDriveHTTP ArDriveHTTP is a package to perform network calls for ArDrive Web. It uses Isolates to perform network calls on Dart VM environments and W

AR.IO 2 Dec 15, 2022
Flutter Local Notifications - Learn how to implement local notifications into both Android and iOS using flutter_local_notifications plugin.

Flutter Local Notifications Example Flutter Local Notifications - Learn how to implement local notifications into both Android and iOS using flutter_l

Sandip Pramanik 12 Nov 29, 2022
Local data hive - Local data hive for flutter

local_data_hive A new Flutter application. ScreenShot

Mehmet Emre ÖZ 0 Jan 8, 2022
Seyifunmi Araoluwa 1 Jan 10, 2022
Parallax - A parallax package for touch-based devices, providing a visually appealing user experience

Parallax A parallax package for touch-based devices, providing a visually appeal

MEDAFOX 4 Sep 28, 2022
Flutter shareable package of object-oriented classes for local caching of user data in json

json_cache Json Cache is an object-oriented package to serve as a layer on top of local storage packages - packages that persist data locally on the u

Dartoos 10 Dec 19, 2022
[Flutter package] An easy and quick way to check if the local app is updated with the same version in their respective stores (Play Store / Apple Store ).

Retrieve version and url for local app update against store app Android and iOS Features Using as reference packages like in_app_update , version_chec

Kauê Murakami 11 Nov 9, 2022
A flutter/dart package that allows developer to develop shiSock client for there application.

A package which allow developers to develop the shiSock client for the there flutter android app. Using flutter-shiSock developers can develop a chat application very easily. It can also be used in app in which we need real time data flow.

shiSock 0 Apr 7, 2022
Tool made in Dart that allows you to dynamically generate JSON files from data models written in Dart.

Dart JSON Generator Versión v1.1.1 Dart JSON Generator es una herramienta que permite generar archivos JSON a partir de mapas como modelos de datos en

Joinner Medina 7 Nov 23, 2022
Flutter blue plus - Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android and iOS

Introduction FlutterBluePlus is a bluetooth plugin for Flutter, a new app SDK to

null 141 Dec 22, 2022
Whatsapp UI clone made with Flutter; it is compatible with any type of Android and iOS devices.

whats_app Whatsapp UI built with Flutter; it is compatible and responsive with any type of Android and iOS devices. Getting Started This project is a

Mustafa Nabavi 4 Sep 23, 2021
Flutter plugin that saves images and videos to devices gallery

Gallery Saver for Flutter Saves images and videos from network or temporary file to external storage. Both images and videos will be visible in Androi

Carnegie Technologies 131 Nov 25, 2022
A Flutter plugin for changing the Home Screen, Lock Screen (or both) Wallpaper on Android devices.

wallpaper_manager A Flutter plugin for changing the Home Screen, Lock Screen (or both) Wallpaper(s) on Android devices. Usage Installation In the pubs

Aditya Mulgundkar 38 Nov 28, 2022
A flutter plugin for retrieving, creating, saving, and watching contacts on native devices

flutter_contact A Flutter plugin to access and manage the device's native contacts. Usage To use this plugin, add flutter_contact as a dependency in y

Sunny 79 Nov 23, 2022
RelativeScale is a simple custom sizing system for flutter widgets to achieve the same physical sizes across different devices.

RelativeScale is a simple custom sizing system for flutter widgets to achieve the same physical sizes across different devices. Usage It is VERY easy

xamantra 19 Nov 25, 2022
Flutter library for sending bytes to Bluetooth devices on Android/iOS

fluetooth A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package that inc

Iandi Santulus 1 Jan 2, 2022