Skip to content

Commit 917f748

Browse files
committed
feat: Add reveal highlight to the search screen
1 parent cf4d1fe commit 917f748

File tree

1 file changed

+39
-30
lines changed

1 file changed

+39
-30
lines changed

lib/screens/search/widgets/search_card.dart

+39-30
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import 'package:fluent_ui/fluent_ui.dart';
44

55
import '../../../widgets/ax_pressure.dart';
66
import '../../../widgets/hover_opacity.dart';
7+
import '../../../widgets/collection_item.dart';
8+
import '../../../widgets/ax_reveal/ax_reveal.dart';
79
import '../../../widgets/context_menu_wrapper.dart';
810
import '../../../providers/responsive_providers.dart';
911

@@ -38,6 +40,8 @@ abstract class SearchCardState<T extends SearchCard> extends State<T> {
3840

3941
@override
4042
Widget build(BuildContext context) {
43+
final brightness = FluentTheme.of(context).brightness;
44+
4145
return ContextMenuWrapper(
4246
contextAttachKey: contextAttachKey,
4347
contextController: contextController,
@@ -110,38 +114,43 @@ abstract class SearchCardState<T extends SearchCard> extends State<T> {
110114
);
111115
}
112116

113-
return Button(
114-
style: const ButtonStyle(
115-
padding: WidgetStatePropertyAll(EdgeInsets.all(0)),
116-
),
117-
onPressed: () => onPressed(context),
118-
child: ClipRRect(
119-
borderRadius: BorderRadius.circular(3),
120-
child: LayoutBuilder(
121-
builder: (context, constraints) {
122-
final size =
123-
min(constraints.maxWidth, constraints.maxHeight);
124-
return Row(
125-
children: [
126-
buildLeadingWidget(size),
127-
Expanded(
128-
child: Padding(
129-
padding: const EdgeInsets.all(8),
130-
child: Column(
131-
crossAxisAlignment: CrossAxisAlignment.start,
132-
mainAxisAlignment: MainAxisAlignment.center,
133-
children: [
134-
Text(
135-
getItemTitle(),
136-
overflow: TextOverflow.ellipsis,
137-
),
138-
],
117+
return AxReveal(
118+
config: brightness == Brightness.dark
119+
? defaultLightRevealConfig
120+
: defaultDarkRevealConfig,
121+
child: Button(
122+
style: const ButtonStyle(
123+
padding: WidgetStatePropertyAll(EdgeInsets.all(0)),
124+
),
125+
onPressed: () => onPressed(context),
126+
child: ClipRRect(
127+
borderRadius: BorderRadius.circular(3),
128+
child: LayoutBuilder(
129+
builder: (context, constraints) {
130+
final size =
131+
min(constraints.maxWidth, constraints.maxHeight);
132+
return Row(
133+
children: [
134+
buildLeadingWidget(size),
135+
Expanded(
136+
child: Padding(
137+
padding: const EdgeInsets.all(8),
138+
child: Column(
139+
crossAxisAlignment: CrossAxisAlignment.start,
140+
mainAxisAlignment: MainAxisAlignment.center,
141+
children: [
142+
Text(
143+
getItemTitle(),
144+
overflow: TextOverflow.ellipsis,
145+
),
146+
],
147+
),
139148
),
140149
),
141-
),
142-
],
143-
);
144-
},
150+
],
151+
);
152+
},
153+
),
145154
),
146155
),
147156
);

0 commit comments

Comments
 (0)