mirror of
https://github.com/immich-app/immich.git
synced 2026-07-30 23:50:36 -07:00
fix: apply disabled styling to UI buttons (#30322)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
co-authored by
shenlong-tanwen
parent
9d03a92b10
commit
7e70f90c15
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user