abinvs-2019 / p2p-transfer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

p2p-transfer file transfer flutter

This project demonstrates how to pair and send data between two devices connected via a WiFi hotspot using Flutter. It uses the wifi_iot package to create a hotspot and the socket_io_client package to establish a client-server model for data transfer.

Features

  • Create a WiFi hotspot
  • Connect to a WiFi hotspot
  • Send data from a client to a server over the hotspot
  • Receive data on the server

Getting Started

Prerequisites

  • Flutter SDK
  • Dart SDK

Installation

  1. Clone the repository:
 git clone https://github.com/jasimameen/p2p-transfer-transfer.git 
  1. Navigate to the project directory:
 cd p2p-transfer 
  1. Install dependencies:
 flutter pub get 

Usage

Create a Hotspot

To create a hotspot, call the createHotspot function.

Connect to a Hotspot

To connect to a hotspot, call the connectToHotspot function with the SSID and password of the hotspot.

Send Data

To send data, call the createClientAndSendData function with the data you want to send.

Receive Data

To receive data, call the createServer function. The server will listen for incoming connections and print received data to the console.

Permissions

Remember to add necessary permissions in your AndroidManifest.xml for Android and Info.plist for iOS. For Android, you would typically need ACCESS_FINE_LOCATION, CHANGE_WIFI_STATE, and ACCESS_WIFI_STATE permissions. For iOS, you'll need to add NSLocalNetworkUsageDescription in your Info.plist.

Contributing

Contributions are welcome! Please read our contributing guidelines to get started.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments


Made with ❤️ by Jasim Ameen


About


Languages

Language:Dart 98.1%Language:Kotlin 1.9%