2022-08-26 08:11:35 +00:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:stackwallet/services/coins/manager.dart';
|
|
|
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
|
|
|
import 'package:stackwallet/utilities/enums/stack_restoring_status.dart';
|
|
|
|
|
|
|
|
class WalletRestoreState extends ChangeNotifier {
|
|
|
|
final String walletId;
|
|
|
|
final String walletName;
|
|
|
|
final Coin coin;
|
|
|
|
late StackRestoringStatus _restoringStatus;
|
|
|
|
Manager? manager;
|
|
|
|
String? address;
|
|
|
|
String? mnemonic;
|
2023-02-03 22:34:06 +00:00
|
|
|
String? mnemonicPassphrase;
|
2022-08-26 08:11:35 +00:00
|
|
|
int? height;
|
|
|
|
|
|
|
|
StackRestoringStatus get restoringState => _restoringStatus;
|
|
|
|
set restoringState(StackRestoringStatus restoringStatus) {
|
|
|
|
_restoringStatus = restoringStatus;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
|
|
|
|
WalletRestoreState({
|
|
|
|
required this.walletId,
|
|
|
|
required this.walletName,
|
|
|
|
required this.coin,
|
|
|
|
required StackRestoringStatus restoringStatus,
|
|
|
|
this.manager,
|
|
|
|
this.address,
|
|
|
|
this.mnemonic,
|
2023-02-03 22:34:06 +00:00
|
|
|
this.mnemonicPassphrase,
|
2022-08-26 08:11:35 +00:00
|
|
|
this.height,
|
|
|
|
}) {
|
|
|
|
_restoringStatus = restoringStatus;
|
|
|
|
}
|
|
|
|
|
|
|
|
WalletRestoreState copyWith({
|
|
|
|
StackRestoringStatus? restoringStatus,
|
|
|
|
String? address,
|
|
|
|
int? height,
|
|
|
|
}) {
|
|
|
|
return WalletRestoreState(
|
|
|
|
walletId: walletId,
|
|
|
|
walletName: walletName,
|
|
|
|
coin: coin,
|
|
|
|
restoringStatus: restoringStatus ?? _restoringStatus,
|
|
|
|
manager: manager,
|
|
|
|
address: this.address,
|
|
|
|
mnemonic: mnemonic,
|
2023-02-03 22:34:06 +00:00
|
|
|
mnemonicPassphrase: mnemonicPassphrase,
|
2022-08-26 08:11:35 +00:00
|
|
|
height: this.height,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|