sync status eta (#1701)

* sync status eta

* other necessary changes

* feat: Enhance Sync ETA display mode

- Enhance block rate calculation with weighted averages(accounts for network flunctuations and sync speed of more recent blocks while calculating eta, basically giving us more accuracy)
- Add option to switch between ETA and blocks remaining display in display settings
- Add placeholder ETA while gathering block data

* chore: Listen to smaller changes in eta

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
Co-authored-by: Blazebrain <davidadegoke16@gmail.com>
This commit is contained in:
Matthew Fosse
2025-08-19 18:09:51 +03:00
committed by GitHub
co-authored by Omar Hatem Blazebrain
parent 013211e7a6
commit c8dca29f68
36 changed files with 361 additions and 8 deletions
@@ -1,5 +1,6 @@
import 'package:cake_wallet/entities/balance_display_mode.dart';
import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/entities/sync_status_display_mode.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:mobx/mobx.dart';
@@ -44,6 +45,9 @@ abstract class DisplaySettingsViewModelBase with Store {
@computed
bool get showAddressBookPopup => _settingsStore.showAddressBookPopupEnabled;
@computed
SyncStatusDisplayMode get syncStatusDisplayMode => _settingsStore.syncStatusDisplayMode;
@computed
String get backgroundImage => _settingsStore.backgroundImage;
@@ -91,6 +95,10 @@ abstract class DisplaySettingsViewModelBase with Store {
@action
void setShowAddressBookPopup(bool value) => _settingsStore.showAddressBookPopupEnabled = value;
@action
void setSyncStatusDisplayMode(SyncStatusDisplayMode value) =>
_settingsStore.syncStatusDisplayMode = value;
@action
void setBackgroundImage(String path) => _settingsStore.backgroundImage = path;
}