Flutter 与原生交互 - android版

上传者: ruoshui_t | 上传时间: 2024-01-10 18:19:38 | 文件大小: 77KB | 文件类型: ZIP
原生与Flutter数据交互,主要就是构建好通道机制 

Flutter 与原生交互使用Platform Channel。Flutter定义了三种不同类型的Channel,它们分别是:
BasicMessageChannel:用于传递字符串和半结构化的信息(双向有返回值)。
MethodChannel:用于传递方法调用(method invocation)(双向有返回值)。
EventChannel: 用于数据流(event streams)的通信(仅支持数据单向传递,无返回值)。

三种Channel之间互相独立,各有用途,但它们在设计上却非常相近。每种Channel均有三个重要成员变量:
name:  String类型,代表Channel的名字,也是其唯一标识符。
messager:BinaryMessenger类型,代表消息信使,是消息的发送与接收的工具。
codec: MessageCodec类型或MethodCodec类型,代表消息的编解码器。

文件下载

资源详情

[{"title":"( 60 个子文件 77KB ) Flutter 与原生交互 - android版","children":[{"title":"flutter_demo_jiaohu-master","children":[{"title":"pubspec.yaml <span style='color:#111;'> 2.61KB </span>","children":null,"spread":false},{"title":"ios","children":[{"title":"Runner","children":[{"title":"Info.plist <span style='color:#111;'> 1.50KB </span>","children":null,"spread":false},{"title":"main.m <span style='color:#111;'> 226B </span>","children":null,"spread":false},{"title":"Base.lproj","children":[{"title":"LaunchScreen.storyboard <span style='color:#111;'> 2.32KB </span>","children":null,"spread":false},{"title":"Main.storyboard <span style='color:#111;'> 1.57KB </span>","children":null,"spread":false}],"spread":true},{"title":"AppDelegate.h <span style='color:#111;'> 103B </span>","children":null,"spread":false},{"title":"Assets.xcassets","children":[{"title":"LaunchImage.imageset","children":[{"title":"LaunchImage.png <span style='color:#111;'> 68B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 336B </span>","children":null,"spread":false},{"title":"LaunchImage@3x.png <span style='color:#111;'> 68B </span>","children":null,"spread":false},{"title":"Contents.json <span style='color:#111;'> 391B </span>","children":null,"spread":false},{"title":"LaunchImage@2x.png <span style='color:#111;'> 68B </span>","children":null,"spread":false}],"spread":true},{"title":"AppIcon.appiconset","children":[{"title":"Icon-App-76x76@2x.png <span style='color:#111;'> 3.22KB </span>","children":null,"spread":false},{"title":"Icon-App-76x76@1x.png <span style='color:#111;'> 1.84KB </span>","children":null,"spread":false},{"title":"Icon-App-29x29@3x.png <span style='color:#111;'> 1.88KB </span>","children":null,"spread":false},{"title":"Icon-App-29x29@1x.png <span style='color:#111;'> 1.00KB </span>","children":null,"spread":false},{"title":"Icon-App-29x29@2x.png <span style='color:#111;'> 1.68KB </span>","children":null,"spread":false},{"title":"Icon-App-60x60@3x.png <span style='color:#111;'> 3.74KB </span>","children":null,"spread":false},{"title":"Icon-App-83.5x83.5@2x.png <span style='color:#111;'> 3.53KB </span>","children":null,"spread":false},{"title":"Icon-App-20x20@2x.png <span style='color:#111;'> 1.25KB </span>","children":null,"spread":false},{"title":"Icon-App-40x40@3x.png <span style='color:#111;'> 2.60KB </span>","children":null,"spread":false},{"title":"Icon-App-40x40@1x.png <span style='color:#111;'> 1.25KB </span>","children":null,"spread":false},{"title":"Icon-App-1024x1024@1x.png <span style='color:#111;'> 10.68KB </span>","children":null,"spread":false},{"title":"Icon-App-40x40@2x.png <span style='color:#111;'> 1.85KB </span>","children":null,"spread":false},{"title":"Icon-App-60x60@2x.png <span style='color:#111;'> 2.60KB </span>","children":null,"spread":false},{"title":"Icon-App-20x20@1x.png <span style='color:#111;'> 564B </span>","children":null,"spread":false},{"title":"Contents.json <span style='color:#111;'> 2.46KB </span>","children":null,"spread":false},{"title":"Icon-App-20x20@3x.png <span style='color:#111;'> 1.55KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"AppDelegate.m <span style='color:#111;'> 424B </span>","children":null,"spread":false}],"spread":true},{"title":"Runner.xcodeproj","children":[{"title":"xcshareddata","children":[{"title":"xcschemes","children":[{"title":"Runner.xcscheme <span style='color:#111;'> 3.21KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"project.xcworkspace","children":[{"title":"contents.xcworkspacedata <span style='color:#111;'> 152B </span>","children":null,"spread":false}],"spread":true},{"title":"project.pbxproj <span style='color:#111;'> 20.48KB </span>","children":null,"spread":false}],"spread":true},{"title":"Flutter","children":[{"title":"Debug.xcconfig <span style='color:#111;'> 30B </span>","children":null,"spread":false},{"title":"Release.xcconfig <span style='color:#111;'> 30B </span>","children":null,"spread":false},{"title":"AppFrameworkInfo.plist <span style='color:#111;'> 794B </span>","children":null,"spread":false}],"spread":true},{"title":"Runner.xcworkspace","children":[{"title":"contents.xcworkspacedata <span style='color:#111;'> 152B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"lib","children":[{"title":"channel","children":[{"title":"MyBasicMessageChannel.dart <span style='color:#111;'> 5.40KB </span>","children":null,"spread":false},{"title":"MyMethodChannel.dart <span style='color:#111;'> 1.11KB </span>","children":null,"spread":false},{"title":"MyEventChannel.dart <span style='color:#111;'> 1.11KB </span>","children":null,"spread":false}],"spread":true},{"title":"main.dart <span style='color:#111;'> 1.83KB </span>","children":null,"spread":false}],"spread":true},{"title":"pubspec.lock <span style='color:#111;'> 3.22KB </span>","children":null,"spread":false},{"title":"android","children":[{"title":"settings.gradle <span style='color:#111;'> 484B </span>","children":null,"spread":false},{"title":"gradle","children":[{"title":"wrapper","children":[{"title":"gradle-wrapper.properties <span style='color:#111;'> 234B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"gradle.properties <span style='color:#111;'> 30B </span>","children":null,"spread":false},{"title":"app","children":[{"title":"src","children":[{"title":"debug","children":[{"title":"AndroidManifest.xml <span style='color:#111;'> 335B </span>","children":null,"spread":false}],"spread":true},{"title":"profile","children":[{"title":"AndroidManifest.xml <span style='color:#111;'> 335B </span>","children":null,"spread":false}],"spread":true},{"title":"main","children":[{"title":"AndroidManifest.xml <span style='color:#111;'> 1.68KB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"mipmap-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 544B </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xxxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 1.41KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 721B </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 442B </span>","children":null,"spread":false}],"spread":false},{"title":"drawable","children":[{"title":"launch_background.xml <span style='color:#111;'> 434B </span>","children":null,"spread":false}],"spread":false},{"title":"values","children":[{"title":"styles.xml <span style='color:#111;'> 361B </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 1.01KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"java","children":[{"title":"com","children":[{"title":"mzw","children":[{"title":"flutter_demo_jiaohu","children":[{"title":"MainActivity.java <span style='color:#111;'> 4.55KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":"build.gradle <span style='color:#111;'> 1.83KB </span>","children":null,"spread":false}],"spread":true},{"title":"build.gradle <span style='color:#111;'> 470B </span>","children":null,"spread":false}],"spread":true},{"title":".metadata <span style='color:#111;'> 306B </span>","children":null,"spread":false},{"title":"test","children":[{"title":"widget_test.dart <span style='color:#111;'> 1.03KB </span>","children":null,"spread":false}],"spread":true},{"title":"README.md <span style='color:#111;'> 553B </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 1.46KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明