onairosapi2 function

Future<void> onairosapi2()

Implementation

Future<void> onairosapi2() async {
    final response = await http.get(Uri.parse('https://api.yourdomain.com/accountinfo'), headers: {
      // If required, add headers for the request
      "Authorization": "Bearer your_token_here",
      "Content-Type": "application/json",
    });

    if (response.statusCode == 200) {
        var result = json.decode(response.body);
        return result;
    } else {
      // Handle error or set state to show an error message
      if (kDebugMode) {
        print('Failed to load account info');
      }
    }
}