Data sharing in local network
![Screenshot 2023-01-11 at 21 39 25](https://private-user-images.githubusercontent.com/29337364/260481411-0a4ab95b-1fd8-4f30-97f2-43e3805894f2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIwMDU5MjgsIm5iZiI6MTcyMjAwNTYyOCwicGF0aCI6Ii8yOTMzNzM2NC8yNjA0ODE0MTEtMGE0YWI5NWItMWZkOC00ZjMwLTk3ZjItNDNlMzgwNTg5NGYyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI2VDE0NTM0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIzZGI3OTRiODFhNDJlNjY2Mjk4OGRjODhjZGY5MWQyNzY5MWZjZmRlNWJiZTM1ZjgwOTM5MTE5MGUyNjk1NjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.WA9r6JgPLE0ovFZF2rF4EGM1cHlpNimV181BfpmA3MY)
NetShare-v2.mp4
Note: This project is mainly running on the latest Flutter beta channel
- Run the project as usual
flutter run -d <target-platforms>
<target-platforms>
is all supported Flutter platforms, except Web.
Normally, desktop app (macOS, Windows, Linux) will be server and mobile app (Android, iOS) will be client role. But roles can be reversed, let's try and enjoy :)
- Build and open app on your target platform as above
For instance, I want to share files between Macbook and Android, so I will build and run app for these platforms. Or you can use released binary files in Releases without building the project.
- Connect
- On Macbook (assume the role of server):
- Enter the current machine's IP address and port (In 1st time, it will automatically get IP and auto-filled it. Next time, it will use the cached previous connected address).
- Enter/paste/pick directory location where the files will be hosted.
- Click on
Start hosting
button
- On Android/iOS (assume the role of client):
- You have two options:
Scan to connect
to scan the address with QR Code generated by server app (on Mac above)Manual connect
to enter address yourself
- After filling IP/port, press
Connect
button and enjoy it
- You have two options:
Note
- Remember to connect both server and client app in the same network
- iOS:
To keep iOS app persisting on your device, recommend running it in release mode:
flutter run --release
(you can not reopen app if running it in debug mode) - Run Hive object generator (only when hive (NoSQL Database) has some major changes or the project lacks
.g.dart
files). By default, all.g.dart
files are committed to the repository so you don't need to re-generate again.
flutter pub run build_runner build --delete-conflicting-outputs