赞
踩
import ‘package:flutter/services.dart’;
void main() {
runApp(BasicMessageChannelDemo());
}
class BasicMessageChannelDemo extends StatefulWidget {
@override
_BasicMessageChannelDemoState createState() => _BasicMessageChannelDemoState();
}
class _BasicMessageChannelDemoState extends State {
var channel = BasicMessageChannel(‘com.example.flutterios.BasicMessageChannel’,StandardMessageCodec());
var _data;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text(“BasicMessageChannelDemo”),),
body: Column(
children: [
SizedBox(
height: 50,
),
RaisedButton(
child: Text(‘发送数据到原生’),
onPressed: () async {
var result = await channel.send({‘name’: ‘张三’, ‘age’: 18}) as Map;
var name = result[‘name’];
var age = result[‘age’];
setState(() {
_data = ‘ n a m e , name, name,age’;
});
},
),
Text(‘原生返回数据:$_data’),
],
),
),
);
}
}
import Flutter
import UIKit
public class BasicMessageChannelDemo {
var channel:FlutterBasicMessageChannel
init(messenger: FlutterBinaryMessenger) {
channel = FlutterBasicMessageChannel(name: “com.example.flutterios.BasicMessageChannel”, binaryMessenger: messenger)
channel.setMessageHandler { (message, reply) in
if let dict = message as? Dictionary<String, Any> {
let name:String = dict[“name”] as? String ?? “”
let age:Int = dict[“age”] as? Int ?? -1
reply([“name”:“hello,(name)”,“age”:age])
}
}
}
}
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
BasicMessageChannelDemo(messenger: controller.binaryMessenger)
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
import ‘package:flutter/foundation.dart’;
import ‘package:flutter/material.dart’;
import ‘package:flutter/services.dart’;
void main() {
runApp(BasicMessageChannelDemo());
}
class BasicMessageChannelDemo extends StatefulWidget {
@override
_BasicMessageChannelDemoState createState() => _BasicMessageChannelDemoState();
}
class _BasicMessageChannelDemoState extends State {
var channel = BasicMessageChannel(‘com.example.flutterios.BasicMessageChannel’,StandardMessageCodec());
var _nativeData;
var _data;
@override
void initState() {
channel.setMessageHandler((message) async{
setState(() {
_nativeData = (message as Map)[‘count’];
});
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text(“BasicMessageChannelDemo”),),
body: Column(
children: [
SizedBox(
height: 50,
),
RaisedButton(
child: Text(‘发送数据到原生’),
onPressed: () async {
var result = await channel.send({‘name’: ‘张三’, ‘age’: 18}) as Map;
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则近万的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Android)
这次面试问的还是还是有难度的,要求当场写代码并且运行,也是很考察面试者写代码
因为Android知识体系比较庞大和复杂的,涉及到计算机知识领域的方方面面。在这里我和身边一些朋友特意整理了一份快速进阶为Android高级工程师的系统且全面的学习资料。涵盖了Android初级——Android高级架构师进阶必备的一些学习技能。
附上:我们之前因为秋招收集的二十套一二线互联网公司Android面试真题(含BAT、小米、华为、美团、滴滴)和我自己整理Android复习笔记(包含Android基础知识点、Android扩展知识点、Android源码解析、设计模式汇总、Gradle知识点、常见算法题汇总。)
里面包含不同方向的自学编程路线、面试题集合/面经、及系列技术文章等,资源持续更新中…
二十套一二线互联网公司Android面试真题(含BAT、小米、华为、美团、滴滴)和我自己整理Android复习笔记(包含Android基础知识点、Android扩展知识点、Android源码解析、设计模式汇总、Gradle知识点、常见算法题汇总。)
[外链图片转存中…(img-y9lF9nss-1711819414064)]
里面包含不同方向的自学编程路线、面试题集合/面经、及系列技术文章等,资源持续更新中…
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。