i am trying to fix CERTIFICATE_VERIFY_FAILED
(in development mode), it seems this answer is good https://stackoverflow.com/a/61312927/8010101, so i tried it, but this error show up
A value of type 'bool Function(X509Certificate, String, int)' can't be assigned to a variable of type 'bool Function(X509Certificate, String, int)?'.
this is my code from main.dart
class MyHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
}
}