void _updateHighlightMode() { _lastInteractionWasTouch = false; //(Platform.isAndroid || Platform.isIOS || !WidgetsBinding.instance.mouseTracker.mouseIsConnected); FocusHighlightMode newMode = FocusHighlightMode.touch; switch (highlightStrategy) { case FocusHighlightStrategy.automatic: if (_lastInteractionWasTouch) { newMode = FocusHighlightMode.touch; } else { newMode = FocusHighlightMode.traditional; } break; case FocusHighlightStrategy.alwaysTouch: newMode = FocusHighlightMode.touch; break; case FocusHighlightStrategy.alwaysTraditional: newMode = FocusHighlightMode.traditional; break; } if (newMode != _highlightMode) { _highlightMode = newMode; _notifyHighlightModeListeners(); } }
void _handleFocusHighlightModeChange(FocusHighlightMode mode) { if (!mounted) { return; } _updateHighlightMode(mode); }
void _handleFocusHighlightModeChange(FocusHighlightMode mode) { if (!mounted) { return; } setState(() => { _focusHighlightMode = mode; }); }
void _updateHighlightMode(FocusHighlightMode mode) { _mayTriggerCallback(task: () => { switch (FocusManager.instance.highlightMode) { case FocusHighlightMode.touch: _canShowHighlight = false; break; case FocusHighlightMode.traditional: _canShowHighlight = true; break; } }); }
public override void initState() { base.initState(); _updateSelectedIndex(); if (widget.focusNode == null) { _internalNode = _internalNode ?? _createFocusNode(); } _actionMap = new Dictionary <LocalKey, ActionFactory>() { { ActivateAction.key, _createAction } }; focusNode.addListener(_handleFocusChanged); FocusManager focusManager = WidgetsBinding.instance.focusManager; _focusHighlightMode = focusManager.highlightMode; focusManager.addHighlightModeListener(_handleFocusHighlightModeChange); }