haveno-app/lib/providers/account_provider.dart
2024-08-19 21:35:24 +01:00

23 lines
708 B
Dart

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