notifyClients method

  1. @override
bool notifyClients()
inherited

Notify the InheritedWidget's dependencies

Implementation

@override
bool notifyClients() {
  // Doesn't test for _useInherited
  // Don't if already in the SetState.builder() function
  final notify = !_inSetStateBuilder;
  if (notify) {
    try {
      // Calls the app's InheritedWidget again
      _inheritedState?.setState(() {});
      // catch any errors if called inappropriately
    } catch (e, stack) {
      // Throw in DebugMode.
      if (kDebugMode) {
        rethrow;
      } else {
        final details = FlutterErrorDetails(
          exception: e,
          stack: stack,
          library: 'state_extended.dart',
          context: ErrorDescription('notifyClient() error in $this'),
        );
        // Record the error
        _logError(details);
      }
    }
  }
  return notify;
}