From 7439d8b0bc70d3208c40713d8442f57b42bf4504 Mon Sep 17 00:00:00 2001 From: Codel1417 Date: Wed, 5 Jun 2024 16:25:57 -0400 Subject: [PATCH] Hide device selector if only 1 gear type known --- lib/Frontend/Widgets/device_type_widget.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Frontend/Widgets/device_type_widget.dart b/lib/Frontend/Widgets/device_type_widget.dart index c5656849..253080c7 100644 --- a/lib/Frontend/Widgets/device_type_widget.dart +++ b/lib/Frontend/Widgets/device_type_widget.dart @@ -1,6 +1,7 @@ import 'package:choice/choice.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:tail_app/Backend/Bluetooth/bluetooth_manager.dart'; import '../../Backend/Definitions/Device/device_definition.dart'; import '../translation_string_definitions.dart'; @@ -13,6 +14,10 @@ class DeviceTypeWidget extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { + if (ref.watch(knownDevicesProvider).length <= 1) { + //onSelectionChanged(DeviceType.values); + return Container(); + } return ListTile( title: Text(deviceType()), subtitle: InlineChoice.multiple(