Register method

Future<Response?> Register(
  1. String text
)

Implementation

Future<Response?> Register(String text) async {
  Response returnResponse;
  try {
    Map<String, String> headers = {"Accept-Language": "en-US"};
    String url = "";
    https.Response response =
        await https.get(Uri.parse("$url?q=$text"), headers: headers).timeout(
      const Duration(seconds: 5),
      onTimeout: () {
        throw FetchDataException('Request timeout');
      },
    );
    returnResponse = Response(
        _returnResponse(response), response.statusCode, response.headers);
  } on SocketException {
    throw FetchDataException('No Internet connection');
  }
  return returnResponse;
}