feat(qol): add smart tag actions, universal zoom, scroll-to-top, desktop hotkeys, and Pawchive provider
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TagChip extends StatelessWidget {
|
||||
const TagChip({required this.tag, this.onTap, super.key});
|
||||
const TagChip({
|
||||
required this.tag,
|
||||
this.onTap,
|
||||
this.onLongPress,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final String tag;
|
||||
final VoidCallback? onTap;
|
||||
final VoidCallback? onLongPress;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return ActionChip(
|
||||
final chip = ActionChip(
|
||||
onPressed: onTap,
|
||||
label: Text(tag),
|
||||
labelStyle: TextStyle(
|
||||
@@ -20,5 +26,11 @@ class TagChip extends StatelessWidget {
|
||||
side: BorderSide(color: scheme.outlineVariant.withValues(alpha: 0.65)),
|
||||
visualDensity: VisualDensity.compact,
|
||||
);
|
||||
if (onLongPress == null) return chip;
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onLongPress: onLongPress,
|
||||
child: chip,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user