refreshAppSettings method

Future<void> refreshAppSettings()

Refreshes app-wide settings such as server time delta.

Implementation

Future<void> refreshAppSettings() async {
  try {
    final serverTimeDelta = await Future<int>.value(
      _serverTimeDeltaResolver(),
    );
    if (_serverTimeDelta == serverTimeDelta) {
      return;
    }
    _serverTimeDelta = serverTimeDelta;
    notifyListeners();
  } catch (_) {
    // Keep the previous delta; before the first successful refresh this
    // intentionally falls back to the local clock.
  }
}