작성
·
457
0
앱 실행은 되는데 웹 링크를 못 엽니다ㅠㅠ
확인 부탁드립니다 !
//오류 내용
I/X509Util( 5126): Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
E/chromium( 5126): [ERROR:ssl_client_socket_impl.cc(946)] handshake failed; returned -1, SSL error code 1, net_error -202
//작성한 코드
import 'package:flutter/material.dart';
import 'package:hello_world/screen/home_screen.dart';
void main() {
// Flutter 프레임워크가
// 앱을 실행할 준비가 될 때까지 기다린다.
WidgetsFlutterBinding.ensureInitialized();
runApp(
MaterialApp(
home: HomeScreen(),
),
);
}
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
final homeUrl = Uri.parse('https://blog.codefactory.ai');
// ignore: must_be_immutable
class HomeScreen extends StatelessWidget {
WebViewController controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..loadRequest(homeUrl);
HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.orange,
title: const Text('yoonjoo'),
actions: [
IconButton(
onPressed: () {
controller.loadRequest(homeUrl);
},
// ignore: prefer_const_constructors
icon: Icon(
Icons.home,
),
),
],
),
body: WebViewWidget(
controller: controller,
),
);
}
}