mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
fix: Custom tooltip null check
This commit is contained in:
parent
ffac89899c
commit
b9e9b50d72
1 changed files with 10 additions and 4 deletions
|
|
@ -41,8 +41,10 @@ class CustomTooltipState extends State<CustomTooltip> {
|
||||||
|
|
||||||
void _showTooltip() {
|
void _showTooltip() {
|
||||||
_timer = Timer(widget.showDelay, () {
|
_timer = Timer(widget.showDelay, () {
|
||||||
_overlayEntry = _createOverlayEntry();
|
_overlayEntry ??= _createOverlayEntry();
|
||||||
Overlay.of(context).insert(_overlayEntry!);
|
if (_overlayEntry != null) {
|
||||||
|
Overlay.of(context).insert(_overlayEntry!);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_timeOut = Timer(const Duration(seconds: 2), () {
|
_timeOut = Timer(const Duration(seconds: 2), () {
|
||||||
|
|
@ -54,7 +56,9 @@ class CustomTooltipState extends State<CustomTooltip> {
|
||||||
void _hideTooltip() {
|
void _hideTooltip() {
|
||||||
_timer?.cancel();
|
_timer?.cancel();
|
||||||
_timeOut?.cancel();
|
_timeOut?.cancel();
|
||||||
_overlayEntry?.remove();
|
if (_overlayEntry?.mounted == true) {
|
||||||
|
_overlayEntry?.remove();
|
||||||
|
}
|
||||||
_overlayEntry = null;
|
_overlayEntry = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,7 +111,9 @@ class CustomTooltipState extends State<CustomTooltip> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
Overlay.of(context).insert(_overlayEntry!);
|
if (_overlayEntry != null) {
|
||||||
|
Overlay.of(context).insert(_overlayEntry!);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue