@@ -36,7 +36,9 @@ class HttpService {
36
36
Duration timeout = const Duration (seconds: 30 ),
37
37
Map <String , String >? headers,
38
38
}) async {
39
- return await http.get (url, headers: headers).handleExceptions (timeout: timeout);
39
+ return await http
40
+ .get (url, headers: headers)
41
+ .handleExceptions (timeout: timeout);
40
42
}
41
43
42
44
//
@@ -50,7 +52,9 @@ class HttpService {
50
52
Duration timeout = const Duration (seconds: 30 ),
51
53
Map <String , String >? headers,
52
54
}) async {
53
- final response = await http.get (url, headers: headers).handleExceptions (timeout: timeout);
55
+ final response = await http
56
+ .get (url, headers: headers)
57
+ .handleExceptions (timeout: timeout);
54
58
return (response, response.bodyJson);
55
59
}
56
60
@@ -65,7 +69,9 @@ class HttpService {
65
69
Duration timeout = const Duration (seconds: 30 ),
66
70
Map <String , String >? headers,
67
71
}) async {
68
- final response = await http.get (url, headers: headers).handleExceptions (timeout: timeout);
72
+ final response = await http
73
+ .get (url, headers: headers)
74
+ .handleExceptions (timeout: timeout);
69
75
return (response, response.bodyBytes);
70
76
}
71
77
@@ -81,7 +87,9 @@ class HttpService {
81
87
}) async {
82
88
final url = composedRequest.$1;
83
89
final body = composedRequest.$2;
84
- return await http.post (url, headers: headers, body: body).handleExceptions (timeout: timeout);
90
+ return await http
91
+ .post (url, headers: headers, body: body)
92
+ .handleExceptions (timeout: timeout);
85
93
}
86
94
87
95
//
@@ -141,7 +149,8 @@ class HttpService {
141
149
/// Returns the current IP address of the device.
142
150
Future <String ?> getCurrentIpAddress () async {
143
151
try {
144
- final response = await http.get (Uri .parse ('https://api.ipify.org?format=json' ));
152
+ final response =
153
+ await http.get (Uri .parse ('https://api.ipify.org?format=json' ));
145
154
if (response.statusCode == 200 ) {
146
155
final jsonData = jsonDecode (response.body);
147
156
return jsonData['ip' ];
0 commit comments