mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
* Run Monero Synchronization task in background on Android * Add monero sync task in the load function to be registered/cancelled when user changes wallets * Revert unused file changes * Register Sync task on all monero wallets if any * Add Sync Modes and change task frequency based on user's choice * Register background task after current wallet is set * Add Sync All toggle and change task wallets to sync accordingly * Enable background notifications in release mode temporarily * Disable constraints and increase the frequency of tasks * Decrease frequency of background tasks * Delay the background task thread till the syncing thread finish (Dummy Trial-1) * Start Sync process and wait for it to finish * Wait for synchronization to finish before ending the background thread Add 10 minutes timeout duration for sync process * Connect to node before syncing wallet * replace testing configuration with the configurations agreed on * Fix Conflicts with main * Update and Migrate Background tasks to null safety * Update workmanager version in pubspec_base also * Move Sync options to Connection and sync page Show Sync options only for Monero and Haven Minor Enhancements * Remove debugging notifications Revert aggressive mode frequency to 6 hours [skip ci] * Add iOS configs * Revert debugging changes Fix conflicts with main * Add/Extract Sync configurations to/from backup file [skip ci]
32 lines
900 B
Dart
32 lines
900 B
Dart
import 'package:cake_wallet/view_model/settings/settings_list_item.dart';
|
|
|
|
class ChoicesListItem<ItemType> extends SettingsListItem {
|
|
ChoicesListItem(
|
|
{required String title,
|
|
required this.selectedItem,
|
|
required this.items,
|
|
String Function(ItemType item)? displayItem,
|
|
void Function(ItemType item)? onItemSelected})
|
|
: _onItemSelected = onItemSelected,
|
|
_displayItem = displayItem,
|
|
super(title);
|
|
|
|
final ItemType selectedItem;
|
|
final List<ItemType> items;
|
|
final String Function(ItemType item)? _displayItem;
|
|
final void Function(ItemType item)? _onItemSelected;
|
|
|
|
void onItemSelected(dynamic item) {
|
|
if (item is ItemType) {
|
|
_onItemSelected?.call(item);
|
|
}
|
|
}
|
|
|
|
String displayItem(dynamic item) {
|
|
if (item is ItemType && _displayItem != null) {
|
|
return _displayItem!.call(item);
|
|
}
|
|
return item.toString();
|
|
}
|
|
}
|