mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-25 03:26:22 +08:00
@@ -136,70 +136,73 @@ class ActionItemState extends State<ActionItem>
|
||||
label: (widget.text ?? "") +
|
||||
(widget.selectStatus ? "已" : "") +
|
||||
widget.semanticsLabel,
|
||||
child: InkWell(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||
onTap: _isThumbsUp
|
||||
? null
|
||||
: () {
|
||||
feedBack();
|
||||
widget.onTap?.call();
|
||||
},
|
||||
onLongPress: _isThumbsUp ? null : widget.onLongPress,
|
||||
onTapDown: _isThumbsUp ? (details) => _startLongPress() : null,
|
||||
onTapUp: _isThumbsUp ? (details) => _cancelLongPress() : null,
|
||||
onTapCancel: _isThumbsUp ? () => _cancelLongPress(true) : null,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
if (widget.needAnim && !_hideCircle)
|
||||
CustomPaint(
|
||||
size: const Size(28, 28),
|
||||
painter: _ArcPainter(
|
||||
color: theme.colorScheme.primary,
|
||||
sweepAngle: _animation!.value,
|
||||
child: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||
onTap: _isThumbsUp
|
||||
? null
|
||||
: () {
|
||||
feedBack();
|
||||
widget.onTap?.call();
|
||||
},
|
||||
onLongPress: _isThumbsUp ? null : widget.onLongPress,
|
||||
onTapDown: _isThumbsUp ? (details) => _startLongPress() : null,
|
||||
onTapUp: _isThumbsUp ? (details) => _cancelLongPress() : null,
|
||||
onTapCancel: _isThumbsUp ? () => _cancelLongPress(true) : null,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
if (widget.needAnim && !_hideCircle)
|
||||
CustomPaint(
|
||||
size: const Size(28, 28),
|
||||
painter: _ArcPainter(
|
||||
color: theme.colorScheme.primary,
|
||||
sweepAngle: _animation!.value,
|
||||
),
|
||||
)
|
||||
else
|
||||
const SizedBox(width: 28, height: 28),
|
||||
Icon(
|
||||
widget.selectStatus
|
||||
? widget.selectIcon!.icon!
|
||||
: widget.icon.icon,
|
||||
size: 18,
|
||||
color: widget.selectStatus
|
||||
? theme.colorScheme.primary
|
||||
: widget.icon.color ?? theme.colorScheme.outline,
|
||||
),
|
||||
],
|
||||
),
|
||||
if (widget.text != null)
|
||||
AnimatedOpacity(
|
||||
opacity: widget.isLoading! ? 0 : 1,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
transitionBuilder:
|
||||
(Widget child, Animation<double> animation) {
|
||||
return ScaleTransition(scale: animation, child: child);
|
||||
},
|
||||
child: Text(
|
||||
widget.text!,
|
||||
key: ValueKey<String>(widget.text!),
|
||||
style: TextStyle(
|
||||
color: widget.selectStatus
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.outline,
|
||||
fontSize: theme.textTheme.labelSmall!.fontSize,
|
||||
),
|
||||
semanticsLabel: "",
|
||||
),
|
||||
)
|
||||
else
|
||||
const SizedBox(width: 28, height: 28),
|
||||
Icon(
|
||||
widget.selectStatus
|
||||
? widget.selectIcon!.icon!
|
||||
: widget.icon.icon,
|
||||
size: 18,
|
||||
color: widget.selectStatus
|
||||
? theme.colorScheme.primary
|
||||
: widget.icon.color ?? theme.colorScheme.outline,
|
||||
),
|
||||
],
|
||||
),
|
||||
if (widget.text != null)
|
||||
AnimatedOpacity(
|
||||
opacity: widget.isLoading! ? 0 : 1,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
transitionBuilder:
|
||||
(Widget child, Animation<double> animation) {
|
||||
return ScaleTransition(scale: animation, child: child);
|
||||
},
|
||||
child: Text(
|
||||
widget.text!,
|
||||
key: ValueKey<String>(widget.text!),
|
||||
style: TextStyle(
|
||||
color: widget.selectStatus
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.outline,
|
||||
fontSize: theme.textTheme.labelSmall!.fontSize,
|
||||
),
|
||||
semanticsLabel: "",
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user