Flutter20 flutter _ WebView 위젯에서 홈으로 이동, 뒤로가기, 새로고침 웹뷰를 구현했을 때, 막상 홈버튼이나 뒤로 가기 버튼이 없을 때가 있다. (혹은 위 이미지 처럼 엉뚱한 페이지로 빠지기도 한다) 이럴 때는 WebViewController를 이용해 해당 WebView 위젯을 컨트롤할 수 있다. WebViewController 사용법 해당 HomeScreen 클래스 안에 null이 올 수 있는 controller라는 공용 변수를 선언한다. class HomeScreen extends StatelessWidget { WebViewController? controller; ... WebView 위젯 파라미터에 onWebViewCreated를 추가한다 이때 받은 controller을 앞서 생성해두었던 공용 변수 this.controller 에 할당한다. class HomeScr.. 2022. 12. 19. flutter _ webview_flutter 를 이용해 앱에서 웹페이지 불러오기 webview_flutter 사용법 webview_flutter 는 웹페이지를 앱 형태로 보여주기위해, WebView 위젯을 제공하는 Flutter 플러그인이다. 설치방법 pubspec.yaml 파일의 dependencies 에 'webview_flutter: {버전}' 을 추가한다. Pub get 하는 거 잊지 말긔. dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 webview_flutter: ^3.0.0 2022. 12. 17. 이전 1 2 3 4 다음