Skip to content

Commit c200fbb

Browse files
committed
fix: click cursor on hover & cleanup
1 parent 2eebe33 commit c200fbb

File tree

4 files changed

+64
-113
lines changed

4 files changed

+64
-113
lines changed

lib/providers/ui_providers.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@ final nameTextFieldFocusNodeProvider =
2929
return focusNode;
3030
});
3131

32-
final collectionSearchQueryProvider = StateProvider<String>((ref) => '');
33-
final environmentSearchQueryProvider = StateProvider<String>((ref) => '');
32+
final searchQueryProvider = StateProvider<String>((ref) => '');

lib/screens/home_page/collection_pane.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class CollectionPane extends ConsumerWidget {
102102
style: Theme.of(context).textTheme.bodyMedium,
103103
hintText: "Filter by name or URL",
104104
onChanged: (value) {
105-
ref.read(collectionSearchQueryProvider.notifier).state =
105+
ref.read(searchQueryProvider.notifier).state =
106106
value.toLowerCase();
107107
},
108108
),
@@ -152,7 +152,7 @@ class _RequestListState extends ConsumerState<RequestList> {
152152
final requestItems = ref.watch(collectionStateNotifierProvider)!;
153153
final alwaysShowCollectionPaneScrollbar = ref.watch(settingsProvider
154154
.select((value) => value.alwaysShowCollectionPaneScrollbar));
155-
final filterQuery = ref.watch(collectionSearchQueryProvider).trim();
155+
final filterQuery = ref.watch(searchQueryProvider).trim();
156156

157157
return Scrollbar(
158158
controller: controller,

lib/screens/mobile/navbar.dart

Lines changed: 61 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_riverpod/flutter_riverpod.dart';
3-
import 'package:apidash/extensions/context_extensions.dart';
4-
import 'package:apidash/providers/ui_providers.dart';
3+
import 'package:apidash/extensions/extensions.dart';
4+
import 'package:apidash/providers/providers.dart';
55

66
class BottomNavBar extends ConsumerWidget {
77
const BottomNavBar({super.key});
@@ -87,78 +87,68 @@ Widget customNavigationDestination(
8787
Function()? onTap,
8888
}) {
8989
bool isSelected = railIdx == buttonIdx;
90-
return TooltipVisibility(
91-
visible: context.isCompactWindow,
92-
child: Tooltip(
93-
message: label,
94-
triggerMode: TooltipTriggerMode.longPress,
95-
verticalOffset: 42,
96-
child: GestureDetector(
97-
behavior: HitTestBehavior.translucent,
98-
onTap: isSelected
99-
? null
100-
: () {
101-
ref.read(navRailIndexStateProvider.notifier).state = buttonIdx;
102-
if (railIdx > 1 && buttonIdx <= 1) {
103-
ref.read(leftDrawerStateProvider.notifier).state = false;
104-
}
105-
onTap?.call();
106-
},
107-
child: Column(
108-
mainAxisAlignment: MainAxisAlignment.center,
109-
children: [
110-
Ink(
111-
width: 65,
112-
height: 32,
113-
decoration: BoxDecoration(
90+
return MouseRegion(
91+
cursor: SystemMouseCursors.click,
92+
child: GestureDetector(
93+
behavior: HitTestBehavior.translucent,
94+
onTap: isSelected
95+
? null
96+
: () {
97+
ref.read(navRailIndexStateProvider.notifier).state = buttonIdx;
98+
if (railIdx > 1 && buttonIdx <= 1) {
99+
ref.read(leftDrawerStateProvider.notifier).state = false;
100+
}
101+
onTap?.call();
102+
},
103+
child: Column(
104+
mainAxisAlignment: MainAxisAlignment.center,
105+
children: [
106+
Ink(
107+
width: 65,
108+
height: 32,
109+
decoration: BoxDecoration(
110+
color: isSelected
111+
? Theme.of(context).colorScheme.secondaryContainer
112+
: Colors.transparent,
113+
borderRadius: BorderRadius.circular(30),
114+
),
115+
child: InkWell(
116+
borderRadius: BorderRadius.circular(30),
117+
onTap: isSelected
118+
? null
119+
: () {
120+
ref.read(navRailIndexStateProvider.notifier).state =
121+
buttonIdx;
122+
if (railIdx > 1 && buttonIdx <= 1) {
123+
ref.read(leftDrawerStateProvider.notifier).state =
124+
false;
125+
}
126+
onTap?.call();
127+
},
128+
child: Icon(
129+
isSelected ? selectedIcon : icon,
114130
color: isSelected
115-
? Theme.of(context).colorScheme.secondaryContainer
116-
: Colors.transparent,
117-
borderRadius: BorderRadius.circular(30),
118-
),
119-
child: InkWell(
120-
borderRadius: BorderRadius.circular(30),
121-
onTap: isSelected
122-
? null
123-
: () {
124-
ref.read(navRailIndexStateProvider.notifier).state =
125-
buttonIdx;
126-
if (railIdx > 1 && buttonIdx <= 1) {
127-
ref.read(leftDrawerStateProvider.notifier).state =
128-
false;
129-
}
130-
onTap?.call();
131-
},
132-
child: Icon(
133-
isSelected ? selectedIcon : icon,
134-
color: isSelected
135-
? Theme.of(context).colorScheme.onSecondaryContainer
136-
: Theme.of(context)
137-
.colorScheme
138-
.onSurface
139-
.withOpacity(0.65),
140-
),
131+
? Theme.of(context).colorScheme.onSecondaryContainer
132+
: Theme.of(context).colorScheme.onSurface.withOpacity(0.65),
141133
),
142134
),
143-
showLabel ? const SizedBox(height: 4) : const SizedBox.shrink(),
144-
showLabel
145-
? Text(
146-
label,
147-
style: Theme.of(context).textTheme.labelSmall!.copyWith(
148-
fontWeight: FontWeight.w600,
149-
color: isSelected
150-
? Theme.of(context)
151-
.colorScheme
152-
.onSecondaryContainer
153-
: Theme.of(context)
154-
.colorScheme
155-
.onSurface
156-
.withOpacity(0.65),
157-
),
158-
)
159-
: const SizedBox.shrink(),
160-
],
161-
),
135+
),
136+
showLabel ? const SizedBox(height: 4) : const SizedBox.shrink(),
137+
showLabel
138+
? Text(
139+
label,
140+
style: Theme.of(context).textTheme.labelSmall!.copyWith(
141+
fontWeight: FontWeight.w600,
142+
color: isSelected
143+
? Theme.of(context).colorScheme.onSecondaryContainer
144+
: Theme.of(context)
145+
.colorScheme
146+
.onSurface
147+
.withOpacity(0.65),
148+
),
149+
)
150+
: const SizedBox.shrink(),
151+
],
162152
),
163153
),
164154
);

lib/widgets/cards.dart

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -152,41 +152,3 @@ class RequestDetailsCard extends StatelessWidget {
152152
);
153153
}
154154
}
155-
156-
class SidebarEnvironmentCard extends StatelessWidget {
157-
const SidebarEnvironmentCard({
158-
super.key,
159-
required this.id,
160-
this.isGlobal = false,
161-
this.isSelected = false,
162-
this.isActive = false,
163-
this.name,
164-
this.editRequestId,
165-
this.onTap,
166-
this.onDoubleTap,
167-
this.onSecondaryTap,
168-
this.onChangedNameEditor,
169-
this.focusNode,
170-
this.onTapOutsideNameEditor,
171-
this.onMenuSelected,
172-
});
173-
174-
final String id;
175-
final bool isGlobal;
176-
final bool isSelected;
177-
final bool isActive;
178-
final String? name;
179-
final String? editRequestId;
180-
final void Function()? onTap;
181-
final void Function()? onDoubleTap;
182-
final void Function()? onSecondaryTap;
183-
final Function(String)? onChangedNameEditor;
184-
final FocusNode? focusNode;
185-
final Function()? onTapOutsideNameEditor;
186-
final Function(RequestItemMenuOption)? onMenuSelected;
187-
188-
@override
189-
Widget build(BuildContext context) {
190-
return const SizedBox();
191-
}
192-
}

0 commit comments

Comments
 (0)