getBalance method

Future<Map<String, dynamic>> getBalance()

Get account balance

Implementation

Future<Map<String, dynamic>> getBalance() async {
  try {
    final response = await _client.get(
      Uri.parse('$_apiBaseUrl/account/area/me/packages')
          .replace(queryParameters: {
        'is_active': '1',
        'p_type': '1',
      }),
      headers: _headers,
    );

    return {
      'success': true,
      'data': jsonDecode(response.body),
    };
  } catch (e) {
    return {
      'success': false,
      'error': e.toString(),
    };
  }
}