Files
PiliPlus/lib/pages/search/widgets/search_text.dart
bggRGjQaUbCoE dda0fc15c7 mod: remove disliked rcmd
Closes #80

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2025-01-01 11:49:45 +08:00

56 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
class SearchText extends StatelessWidget {
final String text;
final ValueChanged<String>? onTap;
final ValueChanged<String>? onLongPress;
final double? fontSize;
final Color? bgColor;
final Color? textColor;
final TextAlign? textAlign;
const SearchText({
super.key,
required this.text,
this.onTap,
this.onLongPress,
this.fontSize,
this.bgColor,
this.textColor,
this.textAlign,
});
@override
Widget build(BuildContext context) {
return Material(
color: bgColor ?? Theme.of(context).colorScheme.onInverseSurface,
borderRadius: BorderRadius.circular(6),
child: Padding(
padding: EdgeInsets.zero,
child: InkWell(
onTap: () {
onTap?.call(text);
},
onLongPress: () {
onLongPress?.call(text);
},
borderRadius: BorderRadius.circular(6),
child: Padding(
padding:
const EdgeInsets.only(top: 5, bottom: 5, left: 11, right: 11),
child: Text(
text,
textAlign: textAlign,
style: TextStyle(
fontSize: fontSize,
color:
textColor ?? Theme.of(context).colorScheme.onSurfaceVariant,
),
),
),
),
),
);
}
}