didChangeAccessibilityFeatures method

  1. @override
  2. @mustCallSuper
void didChangeAccessibilityFeatures()
inherited

Called when the system changes the set of currently active accessibility features.

Implementation

@override
@mustCallSuper
void didChangeAccessibilityFeatures() {
  // A triggered system event
  _hadSystemEvent = true;

  // Don't if the State object is defunct.
  if (!mounted) {
    return;
  }

  ///
  /// This method exposes notifications from [Window.onAccessibilityFeaturesChanged].

  /// No 'setState()' functions are allowed to fully function at this point.
//    _setStateAllowed = false;

  for (final con in controllerList) {
    con.didChangeAccessibilityFeatures();
  }

  _setStateAllowed = true;

  if (_setStateRequested) {
    _setStateRequested = false;
    // Only the latest State is rebuilt
    if (isLastState) {
      /// Perform a 'rebuild' if requested.
      setState(() {});
    }
  }

  // Record the triggered event
  assert(() {
    if (_printEvents) {
      debugPrint(
          '============ Event: didChangeAccessibilityFeatures() in $this');
    }
    return true;
  }());
}