checkCompatibility<T> method
Returns the result of api call to check the version.
path
is the URL the endpoint that returns the response for GET
request
appVersion
is the app version string, for example '1.0.0'
queryParamKey
is the query parameter name, default is 'version'
deserializeFn
is the function callback to deserialize the response JSON
Implementation
Future<T> checkCompatibility<T>({
required String path,
required String appVersion,
String queryParamKey = 'version',
required T Function(Map<String, dynamic> json) deserializeFn,
}) =>
get(path, queryParameters: {queryParamKey: appVersion}).then(
(value) => deserializeFn(value.data),
);