import 'dart:html';
import "package:appwrite/service.dart";
import "package:appwrite/client.dart";
import 'package:dio/dio.dart';
import 'package:meta/meta.dart';
import '../enums.dart';
class Locale extends Service {
Locale(Client client): super(client);
/// 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](https://db-ip.com))
Future get() async {
String path = '/locale';
Map params = {
};
return await this.client.call(HttpMethod.get, path: path, params: params);
}
/// List of all continents. You can use the locale header to get the data in a
/// supported language.
Future getContinents() async {
String path = '/locale/continents';
Map params = {
};
return await this.client.call(HttpMethod.get, path: path, params: params);
}
/// List of all countries. You can use the locale header to get the data in a
/// supported language.
Future getCountries() async {
String path = '/locale/countries';
Map params = {
};
return await this.client.call(HttpMethod.get, path: path, params: params);
}
/// List of all countries that are currently members of the EU. You can use the
/// locale header to get the data in a supported language.
Future getCountriesEU() async {
String path = '/locale/countries/eu';
Map params = {
};
return await this.client.call(HttpMethod.get, path: path, params: params);
}
/// List of all countries phone codes. You can use the locale header to get the
/// data in a supported language.
Future getCountriesPhones() async {
String path = '/locale/countries/phones';
Map params = {
};
return await this.client.call(HttpMethod.get, path: path, params: params);
}
/// List of all currencies, including currency symol, name, plural, and decimal
/// digits for all major and minor currencies. You can use the locale header to
/// get the data in a supported language.
Future getCurrencies() async {
String path = '/locale/currencies';
Map params = {
};
return await this.client.call(HttpMethod.get, path: path, params: params);
}
}