@@ -102,13 +102,14 @@ class SlidableController {
102102 SlidableController (TickerProvider vsync)
103103 : _animationController = AnimationController (vsync: vsync),
104104 endGesture = ValueNotifier (null ),
105- dismissGesture = ValueNotifier (null ),
105+ _dismissGesture = _ValueNotifier (null ),
106106 resizeRequest = ValueNotifier (null ),
107107 actionPaneType = ValueNotifier (ActionPaneType .none) {
108108 _animationController.addListener (_onRatioChanged);
109109 }
110110
111111 final AnimationController _animationController;
112+ final _ValueNotifier <DismissGesture ?> _dismissGesture;
112113
113114 /// Whether the start action pane is enabled.
114115 bool enableStartActionPane = true ;
@@ -156,14 +157,17 @@ class SlidableController {
156157 final ValueNotifier <EndGesture ?> endGesture;
157158
158159 /// Track the dismiss gestures.
159- final ValueNotifier <DismissGesture ?> dismissGesture;
160+ ValueNotifier <DismissGesture ?> get dismissGesture => _dismissGesture ;
160161
161162 /// Track the resize requests.
162163 final ValueNotifier <ResizeRequest ?> resizeRequest;
163164
164165 /// Track the type of the action pane.
165166 final ValueNotifier <ActionPaneType > actionPaneType;
166167
168+ /// Indicates whether the dismissible registered to gestures.
169+ bool get isDismissibleReady => _dismissGesture._hasListeners;
170+
167171 /// Whether this [close()] method has been called and not finished.
168172 bool get closing => _closing;
169173 bool _closing = false ;
@@ -323,6 +327,12 @@ class SlidableController {
323327 }
324328}
325329
330+ class _ValueNotifier <T > extends ValueNotifier <T > {
331+ _ValueNotifier (T value) : super (value);
332+
333+ bool get _hasListeners => hasListeners;
334+ }
335+
326336/// Extensions for [ActionPaneType] .
327337extension ActionPaneTypeX on ActionPaneType {
328338 /// Transforms this [ActionPaneType] to a sign.
0 commit comments