haveno-app/lib/providers/account_provider.dart
2024-09-20 18:16:54 +01:00

23 lines
684 B
Dart

import 'package:flutter/material.dart';
import 'package:haveno/proto/compiled/grpc.pbgrpc.dart';
import 'package:haveno/services/haveno_service.dart';
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");
}
}
}