Fix: connection problems checks
This commit is contained in:
@@ -108,6 +108,7 @@ class _ExamplePageState extends State<ExamplePage> {
|
||||
Future<String> _getToken() async {
|
||||
var url =
|
||||
Uri.http('gymlink.freemyip.com:8080', 'api/auth/authorize_client');
|
||||
try {
|
||||
var response = await http.post(url, body: {
|
||||
'GymKey': 'eeb42dcb-8e5b-4f21-825a-3fc7ada43445',
|
||||
'id': '123'
|
||||
@@ -117,6 +118,9 @@ class _ExamplePageState extends State<ExamplePage> {
|
||||
return '';
|
||||
}
|
||||
return decodedBody['payload']['token'];
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user