同步操作将从 LEARN/MXFlutter 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
MXFlutter is a high-performance Flutter dynamic framework based on JS. It develops Flutter applications by writing JavaScript code in a way similar to Dart's development.More details are here
Email:imatrixteam@qq.com
Flutter 1.5.4 https://storage.googleapis.com/flutter_infra/releases/stable/macos/flutter_macos_v1.5.4-hotfix.2-stable.zip
class HomePage extends MXJSWidget {
constructor(){
super("HomePage", {key: "HomePage"});
}
barSearch(){
return new Container({
child: new Row({
children: [
new Expanded({
child: FlatButton.icon({
onPressed:function(){
this.navigatorPush(new SearchPage);
},
icon: new Icon(new IconData(0xe8b6, {fontFamily: 'MaterialIcons'}),{
color: GlobalConfig.fontColor,
size: 16.0,
}),
label: new Text("坚果R1摄像头损坏",{
style: new TextStyle({
color: GlobalConfig.fontColor,
}),
}),
}),
}),
new Container({
decoration: new BoxDecoration({
border: new BorderDirectional({
start: new BorderSide({
color: GlobalConfig.fontColor,
width: 1.0,
},)
}),
}),
height: 14.0,
width: 1.0,
}),
new Container({
child: FlatButton.icon({
onPressed: function(){
this.navigatorPush(new AskPage);
},
icon: new Icon(new IconData(0xe22b, {fontFamily: 'MaterialIcons'}),{
color: GlobalConfig.fontColor,
size: 16.0,
}),
label: new Text("提问", {
style: new TextStyle({
color: GlobalConfig.fontColor,
}),
}),
}),
}),
],
}),
decoration: new BoxDecoration({
borderRadius: BorderRadius.all(Radius.circular(4.0)),
color: GlobalConfig.searchBackgroundColor,
}),
})
}
build(context){
let widget = new DefaultTabController({
length: 3,
child: new Scaffold({
appBar: new AppBar({
title: this.barSearch(),
bottom: new TabBar({
labelColor: Colors.blue,
indicatorColor: Colors.blue,
unselectedLabelColor: Colors.black(),
tabs: [
new Tab({text: "关注"}),
new Tab({text: "推荐"}),
new Tab({text: "热榜"}),
],
}),
backgroundColor: Colors.white,
}),
body: new TabBarView({
children: [
new Follow(),
new Recommend(),
new Hot(),
]
}),
}),
});
return widget;
}
}
Here, thanks to the author of the Flutter Edition HackSoul, The author draws sample code from zhihu-flutter.
MXJSFlutter.getInstance().setup();
MXJSFlutter.getInstance().runJSApp(jsAppName: "app_test", pageName: null);
class AppTest extends MXJSFlutterApp {
constructor() {
super("app_test", "initRouteName");
}
createJSWidgetWithName(pageName) {
let w = new JSWidgetHomePage;
return w;
}
}
function main(pageName) {
MXJSLog.log("main:pageName" + pageName);
let app = new AppTest;
runApp(app);
}
Navigator.push(context, MaterialPageRoute(builder: (context) => MXJSFlutter.getInstance().navigatorPushWithPageName("JSWidgetHomePage")));
MXFlutter is available under the MIT license. See the LICENSE file for more info.
If you have good comments or suggestions, please feel free to ask us about Issues or Pull Requests.
For those interested in MXFlutter, you could communicate with us by add QQ group:747535761
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。