{"id":271,"date":"2022-10-05T13:57:24","date_gmt":"2022-10-05T04:57:24","guid":{"rendered":"https:\/\/trret.com\/?p=271"},"modified":"2022-10-05T18:40:33","modified_gmt":"2022-10-05T09:40:33","slug":"flutter-webview%eb%a1%9c-%ec%9b%b9%ed%8e%98%ec%9d%b4%ec%a7%80-%eb%9d%84%ec%9a%b0%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/trret.com\/?p=271","title":{"rendered":"[Flutter] WebView\ub85c \uc6f9\ud398\uc774\uc9c0 \ub744\uc6b0\uae30"},"content":{"rendered":"\n<p>1. Flutter\uae30\ubcf8 \uc124\uce58 \ud6c4 (https:\/\/trret.com\/?p=269) Flutter\uc758 \uc0c8\ub85c\uc6b4 \ud504\ub85c\uc81d\ud2b8\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>2. Terminal\uc5d0 flutter pub add webview_flutter \uc785\ub825<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>3. .\/android\/app\/build.gradle\uc5d0 minSdkVersion 19 \ub85c \uc124\uc815<\/p>\n\n\n\n<p>\/\/webview_flutter\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud574\uc11c\ub294 minSdkVersion\uc774 19\uc774\uc0c1 \ud544\uc694<\/p>\n\n\n\n<p>4. .\/lib\/main.dart \uc218\uc815<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:flutter\/material.dart';\nimport 'package:webview_flutter\/webview_flutter.dart';\n\nvoid main() {\n  runApp(const MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  const MyApp({Key? key}) : super(key: key);\n\n  \/\/ This widget is the root of your application.\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      title: 'Trret Demo',\n      theme: ThemeData(\n        primarySwatch: Colors.blue,\n      ),\n      home: const MyHomePage(title: 'Trret Home Page'),\n    );\n  }\n}\n\nclass MyHomePage extends StatelessWidget {\n  const MyHomePage({super.key, required this.title});\n\n  final String title;\n\n  @override\n  Widget build(BuildContext context) {\n    return const Scaffold(\n      body: SafeArea(\n        child: WebView(\n          initialUrl: 'https:\/\/trret.com\/',\n          javascriptMode: JavascriptMode.unrestricted,\n          gestureNavigationEnabled: true,\n          userAgent: \"random\",\n        ),\n      ),\n    );\n  }\n}\n\n<\/code><\/pre>\n\n\n\n<p>5. \ube4c\ub4dc \uc2dc One or more plugins require a higher Android SDK version. \uc5d0\ub7ec\uac00 \ub098\uc62c \ub54c<\/p>\n\n\n\n<p>File - Project Structure - Project \uc5d0 SDK\uac00 \ube68\uac04\uc0c9\uc77c\uac70\uc784. \uc801\uc808\ud55c \ubc84\uc804 \uc120\ud0dd. \ub098\ub294 API 32\uc120\ud0dd.<\/p>\n\n\n\n<p>File - Project Structure - Modules \ubcf4\uba74 Module_SDK\uac00 \ube68\uac04\uc0c9\uc77c\uac70\uc784. \uac19\uc740 \ubc84\uc804 \uc120\ud0dd. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>6. \ube4c\ub4dc \uc2dc Runtime JAR files in the classpath should have the same version. \uc5d0\ub7ec\uac00 \ub098\uc62c \ub54c<\/p>\n\n\n\n<p>build.gradle(Project)\uc5d0 ext.kotlin_version \uc774 build.gradle(Module:app)\uc758 \ubc84\uc804\uacfc \ub9de\uc544\uc57c\ud55c\ub2e4. \ub0b4 \uacbd\uc6b0\uc5d4 1.7.10\uc774\ubbc0\ub85c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>buildscript {\n    ext.kotlin_version = '1.7.10'\n    repositories {\n        google()\n        mavenCentral()\n    }\n\n    dependencies {\n        classpath 'com.android.tools.build:gradle:7.3.0'\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n    }\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Flutter\uae30\ubcf8 \uc124\uce58 \ud6c4 (https:\/\/trret.com\/?p=269) Flutter\uc758 \uc0c8\ub85c\uc6b4 \ud504\ub85c\uc81d\ud2b8\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4 2. Terminal\uc5d0 flutter pub add webview_flutter \uc785\ub825 3. .\/android\/app\/build.gradle\uc5d0 minSdkVersion 19 \ub85c \uc124\uc815 \/\/webview_flutter\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud574\uc11c\ub294 minSdkVersion\uc774 19\uc774\uc0c1 \ud544\uc694 4. .\/lib\/main.dart \uc218\uc815 5. \ube4c\ub4dc \uc2dc One or more plugins require a higher Android SDK version. \uc5d0\ub7ec\uac00 \ub098\uc62c \ub54c File - Project <a href=\"https:\/\/trret.com\/?p=271\" class=\"btn btn-link continue-link\">\ub354 \uc77d\uae30<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[33,35],"tags":[],"_links":{"self":[{"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/posts\/271"}],"collection":[{"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=271"}],"version-history":[{"count":8,"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/posts\/271\/revisions"}],"predecessor-version":[{"id":284,"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/posts\/271\/revisions\/284"}],"wp:attachment":[{"href":"https:\/\/trret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trret.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}