File tree Expand file tree Collapse file tree
open_wearable/lib/widgets/devices Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,7 +181,9 @@ class _ConnectDevicesPageState extends State<ConnectDevicesPage> {
181181 leading: Icon (
182182 isThisDevice ? Icons .smartphone : Icons .bluetooth,
183183 ),
184- title: PlatformText (_deviceName (device)),
184+ title: PlatformText (
185+ _deviceName (device, isThisDevice: isThisDevice),
186+ ),
185187 subtitle: PlatformText (device.id),
186188 trailing: _buildTrailingWidget (
187189 device,
@@ -342,10 +344,16 @@ class _ConnectDevicesPageState extends State<ConnectDevicesPage> {
342344 );
343345 }
344346
345- String _deviceName (DiscoveredDevice device) {
347+ String _deviceName (DiscoveredDevice device, { required bool isThisDevice} ) {
346348 final name = device.name.trim ();
347- if (name.isEmpty) return 'Unnamed device' ;
348- return formatWearableDisplayName (name);
349+ final displayName =
350+ name.isEmpty ? 'Unnamed device' : formatWearableDisplayName (name);
351+
352+ if (isThisDevice) {
353+ return '$displayName (this device)' ;
354+ }
355+
356+ return displayName;
349357 }
350358
351359 String _formatScanTime (DateTime startedAt) {
You can’t perform that action at this time.
0 commit comments