fetchConfig static method
dynamic
fetchConfig()
Implementation
static fetchConfig() async {
String? url = AppUrls.prodConfig;
var dio = Dio();
var response = await dio.request(
url,
options: Options(
method: 'GET',
),
);
if (response.statusCode == 200) {
var data = response.data!;
SharedPreferences sharedPreferences = await DeviceStorage().getInstance();
await sharedPreferences.setString(DeviceStorage.config, jsonEncode(data));
} else {
//print(response.statusMessage);
}
/* String? url = AppUrls.prodConfig;
final response = await _dio!.request(url, options: Options(
method: 'GET',
));
var data = response.data!;
SharedPreferences sharedPreferences = await DeviceStorage().getInstance();
await sharedPreferences.setString(DeviceStorage.config, jsonEncode(data));*/
}