opt mouse control

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-28 15:33:09 +08:00
parent 2031604ea2
commit 5f8dc76891
19 changed files with 268 additions and 191 deletions

View File

@@ -1,3 +1,4 @@
import 'package:PiliPlus/utils/utils.dart';
import 'package:flutter/material.dart';
class SearchText extends StatelessWidget {
@@ -25,12 +26,18 @@ class SearchText extends StatelessWidget {
@override
Widget build(BuildContext context) {
late final colorScheme = Theme.of(context).colorScheme;
final hasLongPress = onLongPress != null;
return Material(
color: bgColor ?? colorScheme.onInverseSurface,
borderRadius: const BorderRadius.all(Radius.circular(6)),
child: InkWell(
onTap: () => onTap?.call(text),
onLongPress: onLongPress != null ? () => onLongPress!(text) : null,
onLongPress: hasLongPress && Utils.isMobile
? () => onLongPress!(text)
: null,
onSecondaryTap: hasLongPress && !Utils.isMobile
? () => onLongPress!(text)
: null,
borderRadius: const BorderRadius.all(Radius.circular(6)),
child: Padding(
padding: