diff --git a/example/lib/home/home.dart b/example/lib/home/home.dart index f0ff19b..65c6f05 100644 --- a/example/lib/home/home.dart +++ b/example/lib/home/home.dart @@ -233,7 +233,9 @@ class _MyAppState extends State { context, MaterialPageRoute( builder: (context) => PeripheralDetailPage( - scanResult.deviceId), + scanResult.deviceId, + scanResult.name ?? "Unknown Peripheral", + ), )); UniversalBle.stopScan(); setState(() { diff --git a/example/lib/peripheral_details/peripheral_detail_page.dart b/example/lib/peripheral_details/peripheral_detail_page.dart index 117ddb0..dca3e64 100644 --- a/example/lib/peripheral_details/peripheral_detail_page.dart +++ b/example/lib/peripheral_details/peripheral_detail_page.dart @@ -14,7 +14,9 @@ import 'package:universal_ble_example/widgets/responsive_view.dart'; class PeripheralDetailPage extends StatefulWidget { final String deviceId; - const PeripheralDetailPage(this.deviceId, {Key? key}) : super(key: key); + final String deviceName; + const PeripheralDetailPage(this.deviceId, this.deviceName, {Key? key}) + : super(key: key); @override State createState() { @@ -191,7 +193,7 @@ class _PeripheralDetailPageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: const Text('Peripheral Details'), + title: Text("${widget.deviceName} - ${widget.deviceId}"), elevation: 4, actions: [ Padding( @@ -277,14 +279,14 @@ class _PeripheralDetailPageState extends State { ), child: Card( child: ListTile( - title: Text( - "Char: ${selectedCharacteristic!.characteristic.uuid}", + title: SelectableText( + "Characteristic: ${selectedCharacteristic!.characteristic.uuid}", ), subtitle: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( + SelectableText( "Service: ${selectedCharacteristic!.service.uuid}", ), Text(