From 6c2178276217bd9a84f8abdc6c93d650175a4ba5 Mon Sep 17 00:00:00 2001 From: anton lobanov Date: Tue, 21 Feb 2023 17:18:30 +0300 Subject: [PATCH] DropDownControlButton isDesabled fixed --- .../drop_down_control_button.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/src/buttons/drop_down_control_button/drop_down_control_button.dart b/lib/src/buttons/drop_down_control_button/drop_down_control_button.dart index 1c84577..af3f40a 100644 --- a/lib/src/buttons/drop_down_control_button/drop_down_control_button.dart +++ b/lib/src/buttons/drop_down_control_button/drop_down_control_button.dart @@ -78,6 +78,7 @@ class _DropDownControlButtonState extends State with Tick final Map _itemsDisabled = {}; late AnimationController _animationController; int _lastSelectedValue = -1; + bool _isDisabled = false; final StreamController, bool>> _streamController = StreamController, bool>>(); /// _DropDownControlButtonState({ @@ -151,22 +152,21 @@ class _DropDownControlButtonState extends State with Tick return StreamBuilder, bool>>( stream: _streamController.stream, builder: (context, snapshots) { - bool isDisabled = false; if (snapshots.hasData) { final point = snapshots.data?.value1; _lastSelectedValue = point?.value ?? _lastSelectedValue; - isDisabled = snapshots.data?.value2 ?? false; + _isDisabled = snapshots.data?.value2 ?? _isDisabled; } - log(_debug, '$_DropDownControlButtonState.build isDisabled: ', isDisabled); + log(_debug, '$_DropDownControlButtonState.build isDisabled: ', _isDisabled); return PopupMenuButtonCustom( // color: backgroundColor, offset: Offset(width != null ? width * 0.7 : 100, height ?? 0), - enabled: !isDisabled, + enabled: !_isDisabled, tooltip: _tooltip, child: Stack( children: [ ColorFiltered( - colorFilter: ColorFilters.disabled(context, isDisabled), + colorFilter: ColorFilters.disabled(context, _isDisabled), child: Container( alignment: Alignment.center, decoration: BoxDecoration(