diff --git a/lib/providers/ui_providers.dart b/lib/providers/ui_providers.dart index e7d67038..2db494b2 100644 --- a/lib/providers/ui_providers.dart +++ b/lib/providers/ui_providers.dart @@ -29,5 +29,4 @@ final nameTextFieldFocusNodeProvider = return focusNode; }); -final collectionSearchQueryProvider = StateProvider((ref) => ''); -final environmentSearchQueryProvider = StateProvider((ref) => ''); +final searchQueryProvider = StateProvider((ref) => ''); diff --git a/lib/screens/home_page/collection_pane.dart b/lib/screens/home_page/collection_pane.dart index 66a3d93a..f1d121b1 100644 --- a/lib/screens/home_page/collection_pane.dart +++ b/lib/screens/home_page/collection_pane.dart @@ -102,7 +102,7 @@ class CollectionPane extends ConsumerWidget { style: Theme.of(context).textTheme.bodyMedium, hintText: "Filter by name or URL", onChanged: (value) { - ref.read(collectionSearchQueryProvider.notifier).state = + ref.read(searchQueryProvider.notifier).state = value.toLowerCase(); }, ), @@ -152,7 +152,7 @@ class _RequestListState extends ConsumerState { final requestItems = ref.watch(collectionStateNotifierProvider)!; final alwaysShowCollectionPaneScrollbar = ref.watch(settingsProvider .select((value) => value.alwaysShowCollectionPaneScrollbar)); - final filterQuery = ref.watch(collectionSearchQueryProvider).trim(); + final filterQuery = ref.watch(searchQueryProvider).trim(); return Scrollbar( controller: controller, diff --git a/lib/screens/mobile/navbar.dart b/lib/screens/mobile/navbar.dart index 81ec1abb..47c16adc 100644 --- a/lib/screens/mobile/navbar.dart +++ b/lib/screens/mobile/navbar.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:apidash/extensions/context_extensions.dart'; -import 'package:apidash/providers/ui_providers.dart'; +import 'package:apidash/extensions/extensions.dart'; +import 'package:apidash/providers/providers.dart'; class BottomNavBar extends ConsumerWidget { const BottomNavBar({super.key}); @@ -87,78 +87,68 @@ Widget customNavigationDestination( Function()? onTap, }) { bool isSelected = railIdx == buttonIdx; - return TooltipVisibility( - visible: context.isCompactWindow, - child: Tooltip( - message: label, - triggerMode: TooltipTriggerMode.longPress, - verticalOffset: 42, - child: GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: isSelected - ? null - : () { - ref.read(navRailIndexStateProvider.notifier).state = buttonIdx; - if (railIdx > 1 && buttonIdx <= 1) { - ref.read(leftDrawerStateProvider.notifier).state = false; - } - onTap?.call(); - }, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Ink( - width: 65, - height: 32, - decoration: BoxDecoration( + return MouseRegion( + cursor: SystemMouseCursors.click, + child: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: isSelected + ? null + : () { + ref.read(navRailIndexStateProvider.notifier).state = buttonIdx; + if (railIdx > 1 && buttonIdx <= 1) { + ref.read(leftDrawerStateProvider.notifier).state = false; + } + onTap?.call(); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Ink( + width: 65, + height: 32, + decoration: BoxDecoration( + color: isSelected + ? Theme.of(context).colorScheme.secondaryContainer + : Colors.transparent, + borderRadius: BorderRadius.circular(30), + ), + child: InkWell( + borderRadius: BorderRadius.circular(30), + onTap: isSelected + ? null + : () { + ref.read(navRailIndexStateProvider.notifier).state = + buttonIdx; + if (railIdx > 1 && buttonIdx <= 1) { + ref.read(leftDrawerStateProvider.notifier).state = + false; + } + onTap?.call(); + }, + child: Icon( + isSelected ? selectedIcon : icon, color: isSelected - ? Theme.of(context).colorScheme.secondaryContainer - : Colors.transparent, - borderRadius: BorderRadius.circular(30), - ), - child: InkWell( - borderRadius: BorderRadius.circular(30), - onTap: isSelected - ? null - : () { - ref.read(navRailIndexStateProvider.notifier).state = - buttonIdx; - if (railIdx > 1 && buttonIdx <= 1) { - ref.read(leftDrawerStateProvider.notifier).state = - false; - } - onTap?.call(); - }, - child: Icon( - isSelected ? selectedIcon : icon, - color: isSelected - ? Theme.of(context).colorScheme.onSecondaryContainer - : Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.65), - ), + ? Theme.of(context).colorScheme.onSecondaryContainer + : Theme.of(context).colorScheme.onSurface.withOpacity(0.65), ), ), - showLabel ? const SizedBox(height: 4) : const SizedBox.shrink(), - showLabel - ? Text( - label, - style: Theme.of(context).textTheme.labelSmall!.copyWith( - fontWeight: FontWeight.w600, - color: isSelected - ? Theme.of(context) - .colorScheme - .onSecondaryContainer - : Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.65), - ), - ) - : const SizedBox.shrink(), - ], - ), + ), + showLabel ? const SizedBox(height: 4) : const SizedBox.shrink(), + showLabel + ? Text( + label, + style: Theme.of(context).textTheme.labelSmall!.copyWith( + fontWeight: FontWeight.w600, + color: isSelected + ? Theme.of(context).colorScheme.onSecondaryContainer + : Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.65), + ), + ) + : const SizedBox.shrink(), + ], ), ), ); diff --git a/lib/widgets/cards.dart b/lib/widgets/cards.dart index 5983608d..fd99d492 100644 --- a/lib/widgets/cards.dart +++ b/lib/widgets/cards.dart @@ -152,41 +152,3 @@ class RequestDetailsCard extends StatelessWidget { ); } } - -class SidebarEnvironmentCard extends StatelessWidget { - const SidebarEnvironmentCard({ - super.key, - required this.id, - this.isGlobal = false, - this.isSelected = false, - this.isActive = false, - this.name, - this.editRequestId, - this.onTap, - this.onDoubleTap, - this.onSecondaryTap, - this.onChangedNameEditor, - this.focusNode, - this.onTapOutsideNameEditor, - this.onMenuSelected, - }); - - final String id; - final bool isGlobal; - final bool isSelected; - final bool isActive; - final String? name; - final String? editRequestId; - final void Function()? onTap; - final void Function()? onDoubleTap; - final void Function()? onSecondaryTap; - final Function(String)? onChangedNameEditor; - final FocusNode? focusNode; - final Function()? onTapOutsideNameEditor; - final Function(RequestItemMenuOption)? onMenuSelected; - - @override - Widget build(BuildContext context) { - return const SizedBox(); - } -}