pub.sev 에 webview
dependencies:
webview_flutter: ^2.0.4
import 'package:webview_flutter/webview_flutter.dart';
WebViewController webViewController;
or
final Completer<WebViewController> _controller =
Completer<WebViewController>();
Scaffold 로 감싼다
Scaffold(
appBar: AppBar(
title:const Text('Flutter WebView example'),
// This drop down menu demonstrates that Flutter widgets can be shown over the web view.
actions: <Widget>[
NavigationControls(_controller.future),
SampleMenu(_controller.future),
],
),
// We're using a Builder here so we have a context that is below the Scaffold// to allow calling Scaffold.of(context) so we can show a snackbar.
body: Builder(builder: (BuildContext context) {
return WebView(
initialUrl: '<https://flutter.dev>',
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_controller.complete(webViewController);
},
onProgress: (int progress) {
print("WebView is loading (progress : $progress%)");
},
javascriptChannels: <JavascriptChannel>{
_toasterJavascriptChannel(context),
},
navigationDelegate: (NavigationRequest request) {
if (request.url.startsWith('<https://www.youtube.com/>')) {
print('blocking navigation to $request}');
return NavigationDecision.prevent;
}
print('allowing navigation to $request');
return NavigationDecision.navigate;
},
onPageStarted: (String url) {
print('Page started loading: $url');
},
onPageFinished: (String url) {
print('Page finished loading: $url');
},
gestureNavigationEnabled:true,
);
}),
floatingActionButton: favoriteButton(),
);
future이여서 async await
https://github.com/semin-flutter-1/flutter-basic/blob/b9d49e13559b09a57eba5cc9056220da3b2f2a15/lib/5_03/main.dart
웹통신
카카오 우편번호