Flutter是Google使用Dart語言開發(fā)的移動(dòng)應(yīng)用開發(fā)框架,使用一套Dart代碼就能構(gòu)建高性能、高保真的iOS和Android應(yīng)用程序,并且在排版、圖標(biāo)、滾動(dòng)、點(diǎn)擊等方面實(shí)現(xiàn)零差異。
2年前,RN剛出來時(shí)做了個(gè)仿拉鉤的demo,react-native-lagou.
這次flutter來了,想感受一下,索性用目前flutter的版本寫的一個(gè)仿boss直聘應(yīng)用。
時(shí)間有限,沒完全仿照,去掉了一些功能,但是界面風(fēng)格一致,有參考價(jià)值。
github地址:flutter仿boss直聘.
感悟
先上效果

部署到手機(jī)
確保flutter正確安裝之后,進(jìn)入目錄運(yùn)行flutter run --release
環(huán)境問題
如果flutter環(huán)境有問題,在.bash_profile里加上如下內(nèi)容
export PUB_HOSTED_URL=https://pub.flutter-io.cnexport FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cnexport PATH=`pwd`/flutter/bin:$PATH
涉及技術(shù)點(diǎn)
1.Theme主題設(shè)置
theme: new ThemeData( primaryIconTheme: const IconThemeData(color: Colors.white), brightness: Brightness.light, primaryColor: new Color.fromARGB(255, 0, 215, 198), accentColor: Colors.cyan[300], )
2.自定義TabBar
@override Widget build(BuildContext context) { assert(debugCheckHasMaterial(context)); double height = _kTextAndIconTabHeight; Widget label = new Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ new Container( child: new Image( image: new AssetImage(this.icon), height: 30.0, width: 30.0, ), margin: const EdgeInsets.only(bottom: _kMarginBottom), ), _buildLabelText() ] ); }3.MD風(fēng)格及一些組件應(yīng)用
new SliverAppBar( expandedHeight: _appBarHeight, pinned: _appBarBehavior == AppBarBehavior.pinned, floating: _appBarBehavior == AppBarBehavior.floating || _appBarBehavior == AppBarBehavior.snapping, snap: _appBarBehavior == AppBarBehavior.snapping, flexibleSpace: new FlexibleSpaceBar( title: new Text(_company.name, style: new TextStyle(color: Colors.white)), background: new Stack( fit: StackFit.expand, children: <Widget>[ new Image.network( 'https://img.bosszhipin.com/beijin/mcs/chatphoto/20170725/861159df793857d6cb984b52db4d4c9c.jpg', fit: BoxFit.cover, height: _appBarHeight, ), ], ), ), )
4.解決了官方demo里路由跳轉(zhuǎn)效果卡頓的問題
Navigator.of(context).push(new PageRouteBuilder( opaque: false, pageBuilder: (BuildContext context, _, __) { return new CompanyDetail(company); }, transitionsBuilder: (_, Animation<double> animation, __, Widget child) { return new FadeTransition( opacity: animation, child: new SlideTransition(position: new Tween<Offset>( begin: const Offset(0.0, 1.0), end: Offset.zero, ).animate(animation), child: child), ); } ))TODO
總結(jié)
以上所述是小編給大家介紹的flutter實(shí)現(xiàn)仿boss直聘,希望對(duì)大家有所幫助,如果大家有任何疑問請給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)VEVB武林網(wǎng)網(wǎng)站的支持!
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注