fix overlay multipli x stesso codice
This commit is contained in:
1 parent
579ddadeff
commit
b0f19ec5c7
4 files changed
+16
-11
No files matched your search
@@ -287,15 +287,15 @@ class _ScannerScreenState extends State<ScannerScreen>
|
||||
|
||||
final now = DateTime.now();
|
||||
|
||||
// 1. Update/Add detected items into sticky cache
|
||||
// 1. Update/Add detected items into sticky cache - key is unique code to prevent duplicate badges
|
||||
for (final item in items) {
|
||||
final key = item.selectionKey;
|
||||
if (_trackedArItems.containsKey(key)) {
|
||||
final entry = _trackedArItems[key]!;
|
||||
entry.item = item; // Update coordinates for live tracking
|
||||
final code = item.code;
|
||||
if (_trackedArItems.containsKey(code)) {
|
||||
final entry = _trackedArItems[code]!;
|
||||
entry.item = item; // Update coordinates for smooth live tracking
|
||||
entry.lastSeen = now;
|
||||
} else {
|
||||
_trackedArItems[key] = _TrackedBarcodeEntry(
|
||||
_trackedArItems[code] = _TrackedBarcodeEntry(
|
||||
item: item,
|
||||
lastSeen: now,
|
||||
);
|
||||
@@ -451,8 +451,10 @@ class _ScannerScreenState extends State<ScannerScreen>
|
||||
if (success) {
|
||||
setState(() {
|
||||
if (_frozenSnapshot != null) {
|
||||
_sentFrozenKeys.add(item.code);
|
||||
_sentFrozenKeys.add(item.selectionKey);
|
||||
} else {
|
||||
_sentLiveKeys.add(item.code);
|
||||
_sentLiveKeys.add(item.selectionKey);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -35,7 +35,8 @@ class ArBarcodeOverlay extends StatelessWidget {
|
||||
safeBounds: safeBounds,
|
||||
measureBadge: (item) => _measureBadge(
|
||||
item,
|
||||
isSent: sentKeys.contains(item.selectionKey),
|
||||
isSent: sentKeys.contains(item.code) ||
|
||||
sentKeys.contains(item.selectionKey),
|
||||
),
|
||||
)
|
||||
: const <int, Rect>{};
|
||||
@@ -71,7 +72,8 @@ class ArBarcodeOverlay extends StatelessWidget {
|
||||
rect: rect,
|
||||
child: _ArCodeBadge(
|
||||
item: item,
|
||||
isSent: sentKeys.contains(item.selectionKey),
|
||||
isSent: sentKeys.contains(item.code) ||
|
||||
sentKeys.contains(item.selectionKey),
|
||||
onTap: onTapBarcode != null ? () => onTapBarcode!(item) : null,
|
||||
),
|
||||
),
|
||||
@@ -197,7 +199,8 @@ class _ArPolygonPainter extends CustomPainter {
|
||||
|
||||
final isPrecisionMode = !showBadges;
|
||||
final isHighlighted = highlightedIndex == item.index;
|
||||
final isSent = sentKeys.contains(item.selectionKey);
|
||||
final isSent = sentKeys.contains(item.code) ||
|
||||
sentKeys.contains(item.selectionKey);
|
||||
|
||||
final Color strokeColor;
|
||||
final double strokeWidth;
|
||||
|
||||
@@ -250,7 +250,7 @@ class _ArFrozenPickerState extends State<ArFrozenPicker> {
|
||||
const SizedBox(height: 8),
|
||||
itemBuilder: (context, index) {
|
||||
final item = snapshot.items[index];
|
||||
final isSent =
|
||||
final isSent = widget.sentKeys.contains(item.code) ||
|
||||
widget.sentKeys.contains(item.selectionKey);
|
||||
return _FrozenCodeRow(
|
||||
item: item,
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 1.0.2+3
|
||||
version: 1.0.3+4
|
||||
|
||||
environment:
|
||||
sdk: ^3.13.4
|
||||
|
||||
Reference in new issue
Block a user