isVersion method

Future<bool> isVersion({
  1. required String version,
  2. Client? client,
})

Implementation

Future<bool> isVersion({
  required String version,
  http.Client? client,
}) async {
  client ??= http.Client();

  if (version.isEmpty) {
    throw ArgumentError(
        'The version must not be empty. A valid example is "2.2"');
  }

  final nodeInfoResponse = await fetchNetworkInfo(client: client);

  return nodeInfoResponse.applicationVersion.version.startsWith(version);
}