callApiGet static method

Future<Response> callApiGet(
  1. String route,
  2. dynamic data, {
  3. String token = '',
})

Implementation

static Future<http.Response> callApiGet(String route,  data, {String token = ''}) async {
		Map<String, String> headers = {};
		headers['Content-Type'] = 'application/json';
		if(token.isNotEmpty){
			headers['Authorization'] = 'Bearer $token';
		}

		return http.get(
				Uri.parse('$apiUrl$route'),
				headers: headers,
		);
	}