Add device connection feature to allow multiple POS devices to share order data #227
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a comprehensive device connection system that allows two or more POS devices to connect and share order data in real-time, addressing the feature request in #[issue_number].
Overview
The feature enables scenarios like having a cashier device for taking orders and a separate kitchen display device for showing orders to prepare. The implementation follows the same architectural patterns as the existing printer system for consistency and maintainability.
Key Features
🔗 Device Connection & Discovery
🔐 Secure Pairing
📱 Device Types & Auto-Connect
📦 Order Data Transmission
Implementation Details
Architecture
The implementation follows the existing codebase patterns:
Integration Points
main.dartalongside printer initializationcart.dartcheckout processdevicesstoreUser Experience
Files Added/Modified
New Core Files
lib/models/device.dart- Device model and repositorylib/models/objects/device_object.dart- Persistence layerlib/services/network.dart- TCP networking and discoverylib/ui/device/- Complete UI for device managementlib/ui/order/widgets/device_button_view.dart- Order page integrationModified Files
lib/main.dart- Added device initialization and network server startuplib/models/repository/cart.dart- Added order data broadcasting on checkoutlib/ui/order/order_page.dart- Integrated device connection UIlib/services/storage.dart- Added devices storage storelib/routes.dart- Added device management routesTesting & Localization
Usage Example
Testing
The implementation includes comprehensive testing:
Security Considerations
Next Steps
make build-l10nto generate localization filesThis feature provides a solid foundation for multi-device POS operations and can be easily extended for additional functionality like bidirectional order status updates or more sophisticated kitchen display features.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://storage.googleapis.com/flutter_infra_release/flutter/c29809135135e262a912cf583b2c90deb9ded610/dart-sdk-linux-x64.zipcurl --retry 3 --continue-at - --location --output /tmp/flutter/bin/cache/dart-sdk-linux-x64.zip REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
Fixes #226
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.