haveno-app/lib/providers/account_provider.dart

24 lines
684 B
Dart
Raw Normal View History

2024-07-14 15:34:24 +00:00
import 'package:flutter/material.dart';
2024-09-20 17:16:54 +00:00
import 'package:haveno/proto/compiled/grpc.pbgrpc.dart';
import 'package:haveno/services/haveno_service.dart';
2024-07-14 15:34:24 +00:00
class AccountProvider with ChangeNotifier {
final HavenoService _havenoService;
bool? _accountExists;
AccountProvider(this._havenoService);
bool? get accountExists => _accountExists;
Future<void> checkAccountExists() async {
try {
final accountExistsReply = await _havenoService.accountClient
.accountExists(AccountExistsRequest());
_accountExists = accountExistsReply.accountExists;
notifyListeners();
} catch (e) {
print("Failed to check if account exists: $e");
}
}
}