MXFlutter是一套基于JS的高性能Flutter动态化框架,它用极类似Dart的开发方式,通过编写JavaScript代码,来开发Flutter应用。
特性支持DartFlutter语法支持定义Flutter中同名Widget类支持定义相同的Build方式,SetState刷新及事件响应方法支持js模块化开发支持VSCode直接调试支持模拟器页面热更新示例代码classHomePageextedsMXJSWidget{costructor(){super("HomePage",{key:"HomePage"});}barSearch(){returewCotaier({child:ewRow({childre:[ewExpaded({child:FlatButto.ico({oPressed:fuctio(){this.avigatorPush(ewSearchPage);},ico:ewIco(ewIcoData(0xe8b6,{fotFamily:'MaterialIcos'}),{color:GlobalCofig.fotColor,size:16.0,}),label:ewText("坚果R1摄像头损坏",{style:ewTextStyle({color:GlobalCofig.fotColor,}),}),}),}),ewCotaier({decoratio:ewBoxDecoratio({border:ewBorderDirectioal({start:ewBorderSide({color:GlobalCofig.fotColor,width:1.0,},)}),}),height:14.0,width:1.0,}),ewCotaier({child:FlatButto.ico({oPressed:fuctio(){this.avigatorPush(ewAskPage);},ico:ewIco(ewIcoData(0xe22b,{fotFamily:'MaterialIcos'}),{color:GlobalCofig.fotColor,size:16.0,}),label:ewText("提问",{style:ewTextStyle({color:GlobalCofig.fotColor,}),}),}),}),],}),decoratio:ewBoxDecoratio({borderRadius:BorderRadius.all(Radius.circular(4.0)),color:GlobalCofig.searchBackgroudColor,}),})}build(cotext){letwidget=ewDefaultTabCotroller({legth:3,child:ewScaffold({appBar:ewAppBar({title:this.barSearch(),bottom:ewTabBar({labelColor:Colors.blue(),idicatorColor:Colors.blue(),uselectedLabelColor:Colors.black(),tabs:[ewTab({text:"关注"}),ewTab({text:"推荐"}),ewTab({text:"热榜"}),],}),backgroudColor:Colors.white(),}),body:ewTabBarView({childre:[ewFollow(),ewRecommed(),ewHot(),]}),}),});returwidget;}}点击空白处退出提示










评论