Exception has occurred. ArgumentError (Invalid argument(s): Invalid internet address

it is showing invalid internet address but API link is working fine

It is throwing error like Exception has occurred. ArgumentError (Invalid argument(s): Invalid internet address fastapi-auth.infinityplus.repl.co)

Here is my code:

Future<UserModel?> register(String password, String phoneNumber) async {
  var url = "https://fastapi-auth.infinityplus.repl.co/auth/register";
  final apiUrl = Uri.parse(url);

  final body = {
  "email": null,
  "password": password,
  "is_active": true,
  "is_superuser": false,
  "is_verified": false,
  "phone": phoneNumber
  };

  try {
    final response = await post(apiUrl, body: json.encode(body));
      if (response.statusCode == 201) {
      final String responseString = response.body;

      return userModelFromJson(responseString);
   } else {
      return null;
   }
 } catch (e) {
    print(e);
  }
}

I am getting an error in

  final response = await post(apiUrl, body: json.encode(body));

  var url = "https://fastapi-auth.infinityplus.repl.co/auth/register";

  final apiUrl = Uri.parse(url);
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum