欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

flutter實(shí)現(xiàn)仿boss直聘功能

 更新時(shí)間:2018年03月16日 09:03:48   作者:kimi_he  
這篇文章主要介紹了flutter實(shí)現(xiàn)仿boss直聘功能,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下

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直聘.

感悟

  1. 與一些文章里介紹的非常相似,如果會(huì)RN,那么學(xué)起來會(huì)很快,flutter借鑒了RN的組件化思想,路由機(jī)制,狀態(tài)機(jī)等。
  2. Dart語法有些奇葩,但掌握之后,開發(fā)效率會(huì)很快,整個(gè)demo加起來開發(fā)了2天不到。
  3. 可以同時(shí)在android和ios運(yùn)行。
  4. 性能很快,超過RN,因?yàn)闆]有bridge層。
  5. 還是要多看官方文檔和源碼,才能碰到問題解決。
  6. IDE還不是很友好,hot reload有時(shí)無效。
  7. 還是比RN要復(fù)雜一些的。

先上效果

部署到手機(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.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export 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

  1. 下拉篩選組件
  2. mock server,模擬真實(shí)請(qǐng)求
  3. 分頁
  4. 目錄結(jié)構(gòu)調(diào)整,更符合生產(chǎn)環(huán)境
  5. viewpager輪播圖
  6. 路由機(jī)制封裝

總結(jié)

以上所述是小編給大家介紹的flutter實(shí)現(xiàn)仿boss直聘,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論