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

23 lines
637 B
Dart

import 'package:flutter/material.dart';
import 'package:haveno/proto/compiled/grpc.pbgrpc.dart';
import 'package:haveno/services/haveno_service.dart';
class GetVersionProvider with ChangeNotifier {
final HavenoService _havenoService;
String? _version;
GetVersionProvider(this._havenoService);
String? get version => _version;
Future<void> fetchVersion() async {
try {
final versionReply =
await _havenoService.getVersionClient.getVersion(GetVersionRequest());
_version = versionReply.version;
notifyListeners();
} catch (e) {
print("Failed to get Haveno version: $e");
}
}
}