뒤로가기 버튼 클릭 시 앱 종료 문제
이렇게 하니까 작동하는 것 같습니다! import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:webview_flutter/webview_flutter.dart'; class HomeScreen extends StatelessWidget { WebViewController? controller; HomeScreen({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return WillPopScope( child: SafeArea( child: Scaffold( body: WebView( onWebViewCreated: (WebViewController controller){ this.controller = controller; }, initialUrl: 'https://127.0.0.1', javascriptMode: JavascriptMode.unrestricted, ), ), ), onWillPop: () { var future = controller!.canGoBack(); future.then((cnaGoBack) { if (cnaGoBack) { controller!.goBack(); } else { SystemNavigator.pop(); } }); return Future.value(false); }, ); } }