import 'dart:convert';
import 'package:http/http.dart' as http;
abstract class ParentRemoteDataSource {
Future<void> create({required Map<String, dynamic> parent});
}
class ParentRemoteDataSourceImpl implements ParentRemoteDataSource {
final http.Client _client = http.Client();
@override
Future<void> create({required Map<String, dynamic> parent}) async {
final Uri uri = Uri.parse(_url);
final Map<String, String> headers = {"Content-Type": "application/json"};
uri,
headers: headers,
body: jsonEncode(parent),
);
print(response.body);
}
}
The code above executes at the press of a button on the UI part.
The error from the post request reads: ERR_CERT_AUTHORITY_INVALID
And below that reads: Uncaught (in promise) Error: XMLHttpRequest error.
There is a screenshot in the attachment. I appreciate any help I can get from the community. Thank you.