mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-08-04 06:52:59 +10:00
Add right-click support to routing sheet path history rows
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../connector/meshcore_connector.dart';
|
import '../connector/meshcore_connector.dart';
|
||||||
|
import '../utils/platform_info.dart';
|
||||||
import '../helpers/path_helper.dart';
|
import '../helpers/path_helper.dart';
|
||||||
import '../l10n/l10n.dart';
|
import '../l10n/l10n.dart';
|
||||||
import '../models/contact.dart';
|
import '../models/contact.dart';
|
||||||
@@ -534,11 +535,19 @@ class _RoutingSheetBodyState extends State<_RoutingSheetBody> {
|
|||||||
l10n.routing_deliveryCounts(record.successCount, record.failureCount),
|
l10n.routing_deliveryCounts(record.successCount, record.failureCount),
|
||||||
];
|
];
|
||||||
|
|
||||||
return Card(
|
return Listener(
|
||||||
margin: const EdgeInsets.symmetric(vertical: 4),
|
onPointerDown: PlatformInfo.isDesktop && hasBytes
|
||||||
child: ListTile(
|
? (event) {
|
||||||
enabled: hasBytes,
|
if (event.buttons == 2) {
|
||||||
leading: CircleAvatar(
|
_showPathDetail(context, connector, contact, record.pathBytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
child: Card(
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||||
|
child: ListTile(
|
||||||
|
enabled: hasBytes,
|
||||||
|
leading: CircleAvatar(
|
||||||
radius: 18,
|
radius: 18,
|
||||||
backgroundColor: bg,
|
backgroundColor: bg,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
@@ -577,13 +586,14 @@ class _RoutingSheetBodyState extends State<_RoutingSheetBody> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
onTap: hasBytes && !inUse
|
onTap: hasBytes && !inUse
|
||||||
? () => _applyHistoryPath(connector, contact, record)
|
? () => _applyHistoryPath(connector, contact, record)
|
||||||
: null,
|
: null,
|
||||||
onLongPress: hasBytes
|
onLongPress: hasBytes
|
||||||
? () =>
|
? () =>
|
||||||
_showPathDetail(context, connector, contact, record.pathBytes)
|
_showPathDetail(context, connector, contact, record.pathBytes)
|
||||||
: null,
|
: null,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user