{"id":51753,"date":"2026-03-13T12:32:28","date_gmt":"2026-03-13T04:32:28","guid":{"rendered":"https:\/\/www.zhidianwl.com\/zhidian\/?p=51753"},"modified":"2026-03-13T12:32:28","modified_gmt":"2026-03-13T04:32:28","slug":"ios%e5%bc%80%e5%8f%91flutter-%e6%a8%a1%e5%9d%97%e6%b7%b7%e7%bc%96%e6%89%93%e5%8c%85%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.zhidianwl.com\/zhidian\/2026\/51753\/","title":{"rendered":"ios\u5f00\u53d1flutter \u6a21\u5757\u6df7\u7f16\u6253\u5305\u65b9\u6cd5"},"content":{"rendered":"<p>iOS\u5f00\u53d1\u4e2d\uff0c\u5982\u679c\u6211\u4eec\u5e0c\u671b\u4f7f\u7528Flutter\u5f00\u53d1\u7684\u6a21\u5757\u548c\u539f\u751fiOS\u4ee3\u7801\u4e00\u8d77\u8fdb\u884c\u6df7\u7f16\u5e76\u6253\u5305\uff0c\u53ef\u4ee5\u4f7f\u7528Flutter\u7684&#8221;Add-to-App&#8221;\u529f\u80fd\u3002\u8fd9\u4e2a\u529f<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/cdn.myapp.ltd\/ag\/100\/ios\/43.jpg\" \/><\/figure>\n<\/p>\n<p>\u80fd\u5141\u8bb8\u6211\u4eec\u5c06Flutter\u89c6\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684\u6a21\u5757\uff0c\u5c06\u5176\u5d4c\u5165\u5230\u73b0\u6709\u7684iOS\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002<\/p>\n<p>\u6df7\u7f16\u6253\u5305\u7684\u539f\u7406\u662f\u5728\u5df2\u6709\u7684iOS\u9879\u76ee\u4e2d\u96c6\u6210Flutter\u5f15\u64ce\uff0c\u5e76\u901a\u8fc7Flutter Engine\u7684\u5d4c\u5165\u65b9\u5f0f\u5c06Flutter\u89c6\u56fe\u6dfb\u52a0\u5230\u539f\u751f\u5e94\u7528\u7684\u754c\u9762\u4e2d\u3002<\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728iOS\u9879\u76ee\u4e2d\u5b9e\u73b0Flutter\u6a21\u5757\u7684\u6df7\u7f16\u6253\u5305\u3002<\/p>\n<p>**\u6b65\u9aa4\u4e00\uff1a\u521b\u5efaFlutter\u6a21\u5757**<\/p>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u72ec\u7acb\u7684Flutter\u6a21\u5757\u3002\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u521b\u5efa\u4e00\u4e2a\u57fa\u672c\u7684Flutter\u6a21\u5757\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>flutter create &#8211;template module flutter_module<\/p>\n<p>&#8220;`<\/p>\n<p>\u8fd9\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a&#8221;flutter_module&#8221;\u7684Flutter\u6a21\u5757\u3002<\/p>\n<p>**\u6b65\u9aa4\u4e8c\uff1a\u914d\u7f6eiOS\u5de5\u7a0b**<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u8fdb\u5165\u5230\u4f60\u7684iOS\u5de5\u7a0b\u4e2d\u3002\u6253\u5f00\u7ec8\u7aef\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u5165\u5230Flutter\u6a21\u5757\u76ee\u5f55\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>cd \/path\/to\/your\/ios\/project\/flutter_module<\/p>\n<p>&#8220;`<\/p>\n<p>\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06Flutter\u6a21\u5757\u6dfb\u52a0\u5230iOS\u5de5\u7a0b\u4e2d\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p><a href=\"https:\/\/www.applebyme.ltd\/ios-dabao-2579.html\">\u600e\u4e48\u53d6\u6d88ios\u7b7e\u540d\u5f00\u53d1\u6253\u5305\u5c01\u88c5<\/a><\/p>\n<p>flutter add-to-app &#8211;ios<\/p>\n<p>&#8220;`<\/p>\n<p>\u8fd9\u5c06\u4f1a\u81ea\u52a8\u751f\u6210\u4e00\u4e2aiOS\u5de5\u7a0b\u76ee\u5f55\uff0c\u8be5\u76ee\u5f55\u5305\u542b\u4e86Flutter\u6a21\u5757\u6240\u9700\u7684\u6587\u4ef6\u3002<\/p>\n<p>**\u6b65\u9aa4\u4e09\uff1a\u914d\u7f6eiOS\u5de5\u7a0b\u7684Flutter\u5f15\u64ce**<\/p>\n<p>\u8fdb\u5165\u5230iOS\u5de5\u7a0b\u76ee\u5f55\uff0c\u627e\u5230`Runner`\u6587\u4ef6\u5939\uff0c\u5c06\u5176\u4e2d\u7684`main.dart`\u6587\u4ef6\u5220\u9664\uff0c\u7136\u540e\u5c06Flutter\u6a21\u5757\u4e2d\u7684`lib\/main.dart`\u6587\u4ef6\u590d\u5236\u5230`Runner`\u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6253\u5f00`AppDelegate.swift`\u6587\u4ef6\uff0c\u5e76\u5728\u5bfc\u5165\u8bed\u53e5\u4e0b\u65b9\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>import Flutter<\/p>\n<p>import UIKit<\/p>\n<p>import FlutterPluginRegistrant<\/p>\n<p>@UIApplicationMain<\/p>\n<p>@objc class AppDelegate: FlutterAppDelegate {<\/p>\n<p>  var flutterEngine : FlutterEngine?;<\/p>\n<p>  override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {<\/p>\n<p>    flutterEngine = FlutterEngine(name: &#8220;my flutter engine&#8221;)<\/p>\n<p>    flutterEngine.run()<\/p>\n<p>    GeneratedPluginRegistrant.register(with: self.flutterEngine!)<\/p>\n<p>    return super.application(application, didFinishLaunchingWithOptions: launchOptions)<\/p>\n<p>  }<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>\u8fd9\u4e9b\u4ee3\u7801\u521b\u5efa\u4e86\u4e00\u4e2aFlutterEngine\u5bf9\u8c61\uff0c\u5e76\u5728\u5e94\u7528\u542f\u52a8\u65f6\u8fd0\u884c\u8be5FlutterEngine\u5bf9\u8c61\u3002<\/p>\n<p>**\u6b65\u9aa4\u56db\uff1a\u914d\u7f6eFlutter\u6a21\u5757\u7684\u4f9d\u8d56**<\/p>\n<p>\u6253\u5f00Flutter\u6a21\u5757\u7684`pubspec.yaml`\u6587\u4ef6\uff0c\u5728`dependencies`\u4e0b\u65b9\u6dfb\u52a0\u4f60\u7684iOS\u5de5\u7a0b\u7684\u4f9d\u8d56\uff0c\u5982\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>dependencies:<\/p>\n<p>  flutter:<\/p>\n<p>    sdk: flutter<\/p>\n<p>  flutter_test:<\/p>\n<p>    sdk: flutter<\/p>\n<p>  your_ios_project:<\/p>\n<p>    path: \/path\/to\/your\/ios\/project<\/p>\n<p>&#8220;`<\/p>\n<p>\u5c06`path`\u66ff\u6362\u4e3a\u4f60\u7684iOS\u5de5\u7a0b\u7684\u8def\u5f84\u3002<\/p>\n<p>**\u6b65\u9aa4\u4e94\uff1a\u7f16\u8bd1\u548c\u8fd0\u884c**<\/p>\n<p>\u5b8c\u6210\u4ee5\u4e0a\u6b65\u9aa4\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u6a21\u62df\u5668\u4e0a\u7f16<a href=\"https:\/\/www.applebyme.ltd\/ios-dabao-1949.html\">ue4\u9879\u76eeios\u6253\u5305<\/a>\u8bd1\u548c\u8fd0\u884ciOS\u5e94\u7528\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>flutter run<\/p>\n<p>&#8220;`<\/p>\n<p>\u8fd9\u5c06\u7f16\u8bd1\u5e76\u542f\u52a8\u4f60\u7684iOS\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u5c06Flutter\u5f15\u64ce\u5d4c\u5165\u8fdb\u53bb\u3002<\/p>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5b9e\u73b0Flutter\u6a21\u5757\u548c\u539f\u751fiOS\u4ee3\u7801\u7684\u6df7\u7f16\uff0c\u5e76\u4e00\u8d77\u8fdb\u884c\u6253\u5305\u3002\u8fd9\u6837\u53ef\u4ee5\u4f7f\u5f97\u539f\u672c\u7684iOS\u5e94\u7528\u7a0b\u5e8f\u5177\u5907\u66f4\u5f3a\u5927\u7684\u529f\u80fd\u548c\u7528\u6237\u4f53\u9a8c\u3002\u540c\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u66f4\u597d\u5730\u5229\u7528Flutter\u7684\u8de8\u5e73\u53f0\u7279\u6027\uff0c\u51cf\u5c11\u91cd\u590d\u4ee3\u7801\u5f00\u53d1\u3002<\/p>\n<p>\u603b\u7ed3\u4e00\u4e0b\uff0c\u5b9e\u73b0iOS\u5f00\u53d1\u4e2dFlutter\u6a21\u5757\u7684\u6df7\u7f16\u6253\u5305\uff0c\u9700\u8981\u521b\u5efaFlutter\u6a21\u5757\u3001\u5c06Flutter\u6a21\u5757\u5d4c\u5165\u5230iOS\u5de5\u7a0b\u4e2d\u3001\u914d\u7f6eiOS\u5de5\u7a0b\u7684Flutter\u5f15\u64ce\u3001\u914d\u7f6eFlutter\u6a21\u5757\u7684\u4f9d\u8d56\uff0c\u5e76\u6700\u540e\u8fdb\u884c\u7f16\u8bd1\u548c\u8fd0\u884c\u3002\u901a\u8fc7\u8fd9\u4e2a\u8fc7\u7a0b\uff0c\u6211\u4eec\u53ef\u4ee5\u5145\u5206\u5229\u7528Flutter\u7684\u4f18\u52bf\uff0c\u5c06\u539f\u751fiOS\u5e94\u7528\u548c\u8de8\u5e73\u53f0\u80fd\u529b\u6709\u673a\u7ed3\u5408\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>iOS\u5f00\u53d1\u4e2d\uff0c\u5982\u679c\u6211\u4eec\u5e0c\u671b\u4f7f\u7528Flutter\u5f00\u53d1\u7684\u6a21\u5757\u548c\u539f\u751fiOS\u4ee3\u7801\u4e00\u8d77\u8fdb\u884c\u6df7\u7f16\u5e76\u6253\u5305\uff0c\u53ef\u4ee5\u4f7f\u7528Flutter\u7684\\&#8221;Add-to-App\\&#8221;\u529f\u80fd\u3002\u8fd9\u4e2a\u529f\u80fd\u5141\u8bb8\u6211\u4eec\u5c06Flutter\u89c6\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684\u6a21\u5757\uff0c\u5c06<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[39772,38850,9099,634,1066],"class_list":["post-51753","post","type-post","status-publish","format-standard","hentry","category-zuoapp","tag-ios","tag-unity-ios-","tag-9099","tag-634","tag-1066"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/51753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/comments?post=51753"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/51753\/revisions"}],"predecessor-version":[{"id":51769,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/posts\/51753\/revisions\/51769"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/media?parent=51753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/categories?post=51753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.com\/zhidian\/wp-json\/wp\/v2\/tags?post=51753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}