mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
aggregated search
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
part of 'components.dart';
|
||||
|
||||
class MouseBackDetector extends StatelessWidget {
|
||||
const MouseBackDetector({super.key, required this.onTapDown, required this.child});
|
||||
const MouseBackDetector(
|
||||
{super.key, required this.onTapDown, required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@@ -20,3 +21,45 @@ class MouseBackDetector extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AnimatedTapRegion extends StatefulWidget {
|
||||
const AnimatedTapRegion({
|
||||
super.key,
|
||||
required this.child,
|
||||
required this.onTap,
|
||||
this.borderRadius = 0,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
|
||||
final void Function() onTap;
|
||||
|
||||
final double borderRadius;
|
||||
|
||||
@override
|
||||
State<AnimatedTapRegion> createState() => _AnimatedTapRegionState();
|
||||
}
|
||||
|
||||
class _AnimatedTapRegionState extends State<AnimatedTapRegion> {
|
||||
bool isHovered = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MouseRegion(
|
||||
onEnter: (_) => setState(() => isHovered = true),
|
||||
onExit: (_) => setState(() => isHovered = false),
|
||||
child: GestureDetector(
|
||||
onTap: widget.onTap,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(widget.borderRadius),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: AnimatedScale(
|
||||
duration: _fastAnimationDuration,
|
||||
scale: isHovered ? 1.1 : 1,
|
||||
child: widget.child,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -78,6 +78,9 @@ class _SmoothScrollProviderState extends State<SmoothScrollProvider> {
|
||||
},
|
||||
onPointerSignal: (pointerSignal) {
|
||||
if (pointerSignal is PointerScrollEvent) {
|
||||
if (HardwareKeyboard.instance.isShiftPressed) {
|
||||
return;
|
||||
}
|
||||
if (pointerSignal.kind == PointerDeviceKind.mouse &&
|
||||
!_isMouseScroll) {
|
||||
setState(() {
|
||||
|
@@ -267,13 +267,14 @@ class OptionChip extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return AnimatedContainer(
|
||||
duration: _fastAnimationDuration,
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? context.colorScheme.primaryContainer
|
||||
? context.colorScheme.secondaryContainer
|
||||
: context.colorScheme.surface,
|
||||
border: isSelected
|
||||
? Border.all(color: context.colorScheme.primaryContainer)
|
||||
? Border.all(color: context.colorScheme.secondaryContainer)
|
||||
: Border.all(color: context.colorScheme.outline),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
|
Reference in New Issue
Block a user