fix: apply disabled styling to UI buttons

This commit is contained in:
shenlong-tanwen
2026-07-28 18:21:28 +05:30
parent fbf4535469
commit 470fc23d15
3 changed files with 9 additions and 42 deletions
@@ -43,21 +43,10 @@ class _ImmichColumnButtonState extends State<ImmichColumnButton> {
}
}
Future<void>? _onPressed() {
if (_isDisabled) {
return null;
}
VoidCallback? get _onPressed => _isDisabled ? null : () => _runAction(widget.onPressed);
return _runAction(widget.onPressed);
}
Future<void>? _onLongPress() {
if (_isDisabled || widget.onLongPress == null) {
return null;
}
return _runAction(widget.onLongPress!);
}
VoidCallback? get _onLongPress =>
_isDisabled || widget.onLongPress == null ? null : () => _runAction(widget.onLongPress!);
@override
Widget build(BuildContext context) {
@@ -44,21 +44,10 @@ class _ImmichIconButtonState extends State<ImmichIconButton> {
}
}
Future<void>? _onPressed() {
if (_isDisabled) {
return null;
}
VoidCallback? get _onPressed => _isDisabled ? null : () => _runAction(widget.onPressed);
return _runAction(widget.onPressed);
}
Future<void>? _onLongPress() {
if (_isDisabled || widget.onLongPress == null) {
return null;
}
return _runAction(widget.onLongPress!);
}
VoidCallback? get _onLongPress =>
_isDisabled || widget.onLongPress == null ? null : () => _runAction(widget.onLongPress!);
@override
Widget build(BuildContext context) {
@@ -46,21 +46,10 @@ class _ImmichTextButtonState extends State<ImmichTextButton> {
}
}
Future<void>? _onPressed() {
if (_isDisabled) {
return null;
}
VoidCallback? get _onPressed => _isDisabled ? null : () => _runAction(widget.onPressed);
return _runAction(widget.onPressed);
}
Future<void>? _onLongPress() {
if (_isDisabled || widget.onLongPress == null) {
return null;
}
return _runAction(widget.onLongPress!);
}
VoidCallback? get _onLongPress =>
_isDisabled || widget.onLongPress == null ? null : () => _runAction(widget.onLongPress!);
@override
Widget build(BuildContext context) {