get method

Future<Locale> get()

Get user locale

Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.

(IP Geolocation by DB-IP)

Implementation

Future<models.Locale> get() async {
  final String apiPath = '/locale';

  final Map<String, dynamic> apiParams = {};

  final Map<String, String> apiHeaders = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.get,
      path: apiPath, params: apiParams, headers: apiHeaders);

  return models.Locale.fromMap(res.data);
}