feat(ui): add themed shell navigation
This commit is contained in:
@ -65,7 +65,7 @@ class _ConnectDevicePageState extends ConsumerState<ConnectDevicePage>
|
||||
title: const Text('Connect Device'),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () => context.go('/'),
|
||||
onPressed: () => context.go('/devices'),
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
@ -188,7 +188,10 @@ class _ConnectDevicePageState extends ConsumerState<ConnectDevicePage>
|
||||
return;
|
||||
} else {
|
||||
final res = await controller.connect(device);
|
||||
print('res: $res');
|
||||
if (!mounted) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (res) {
|
||||
case Ok():
|
||||
// trigger pairing/permission prompt if needed
|
||||
@ -231,6 +234,9 @@ class _ConnectDevicePageState extends ConsumerState<ConnectDevicePage>
|
||||
}
|
||||
break;
|
||||
case Err(:final v):
|
||||
if (!context.mounted) {
|
||||
break;
|
||||
}
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
@ -239,7 +245,6 @@ class _ConnectDevicePageState extends ConsumerState<ConnectDevicePage>
|
||||
break;
|
||||
}
|
||||
}
|
||||
print('Tapped on ${device.id}');
|
||||
},
|
||||
child: DeviceListItem(
|
||||
deviceName: deviceName,
|
||||
|
||||
Reference in New Issue
Block a user