fix: click cursor on hover & cleanup

This commit is contained in:
DenserMeerkat
2024-06-13 01:07:53 +05:30
parent 2eebe33d3b
commit c200fbb56e
4 changed files with 64 additions and 113 deletions

View File

@ -29,5 +29,4 @@ final nameTextFieldFocusNodeProvider =
return focusNode; return focusNode;
}); });
final collectionSearchQueryProvider = StateProvider<String>((ref) => ''); final searchQueryProvider = StateProvider<String>((ref) => '');
final environmentSearchQueryProvider = StateProvider<String>((ref) => '');

View File

@ -102,7 +102,7 @@ class CollectionPane extends ConsumerWidget {
style: Theme.of(context).textTheme.bodyMedium, style: Theme.of(context).textTheme.bodyMedium,
hintText: "Filter by name or URL", hintText: "Filter by name or URL",
onChanged: (value) { onChanged: (value) {
ref.read(collectionSearchQueryProvider.notifier).state = ref.read(searchQueryProvider.notifier).state =
value.toLowerCase(); value.toLowerCase();
}, },
), ),
@ -152,7 +152,7 @@ class _RequestListState extends ConsumerState<RequestList> {
final requestItems = ref.watch(collectionStateNotifierProvider)!; final requestItems = ref.watch(collectionStateNotifierProvider)!;
final alwaysShowCollectionPaneScrollbar = ref.watch(settingsProvider final alwaysShowCollectionPaneScrollbar = ref.watch(settingsProvider
.select((value) => value.alwaysShowCollectionPaneScrollbar)); .select((value) => value.alwaysShowCollectionPaneScrollbar));
final filterQuery = ref.watch(collectionSearchQueryProvider).trim(); final filterQuery = ref.watch(searchQueryProvider).trim();
return Scrollbar( return Scrollbar(
controller: controller, controller: controller,

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:apidash/extensions/context_extensions.dart'; import 'package:apidash/extensions/extensions.dart';
import 'package:apidash/providers/ui_providers.dart'; import 'package:apidash/providers/providers.dart';
class BottomNavBar extends ConsumerWidget { class BottomNavBar extends ConsumerWidget {
const BottomNavBar({super.key}); const BottomNavBar({super.key});
@ -87,12 +87,8 @@ Widget customNavigationDestination(
Function()? onTap, Function()? onTap,
}) { }) {
bool isSelected = railIdx == buttonIdx; bool isSelected = railIdx == buttonIdx;
return TooltipVisibility( return MouseRegion(
visible: context.isCompactWindow, cursor: SystemMouseCursors.click,
child: Tooltip(
message: label,
triggerMode: TooltipTriggerMode.longPress,
verticalOffset: 42,
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: isSelected onTap: isSelected
@ -133,10 +129,7 @@ Widget customNavigationDestination(
isSelected ? selectedIcon : icon, isSelected ? selectedIcon : icon,
color: isSelected color: isSelected
? Theme.of(context).colorScheme.onSecondaryContainer ? Theme.of(context).colorScheme.onSecondaryContainer
: Theme.of(context) : Theme.of(context).colorScheme.onSurface.withOpacity(0.65),
.colorScheme
.onSurface
.withOpacity(0.65),
), ),
), ),
), ),
@ -147,9 +140,7 @@ Widget customNavigationDestination(
style: Theme.of(context).textTheme.labelSmall!.copyWith( style: Theme.of(context).textTheme.labelSmall!.copyWith(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: isSelected color: isSelected
? Theme.of(context) ? Theme.of(context).colorScheme.onSecondaryContainer
.colorScheme
.onSecondaryContainer
: Theme.of(context) : Theme.of(context)
.colorScheme .colorScheme
.onSurface .onSurface
@ -160,6 +151,5 @@ Widget customNavigationDestination(
], ],
), ),
), ),
),
); );
} }

View File

@ -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();
}
}