资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

flutter如何实现仿boss直聘功能

小编给大家分享一下flutter如何实现仿boss直聘功能,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

10年积累的做网站、网站建设经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站制作后付款的网站建设流程,更有果洛州免费网站建设让你可以放心的选择与我们合作。

感悟

  1. 与一些文章里介绍的非常相似,如果会RN,那么学起来会很快,flutter借鉴了RN的组件化思想,路由机制,状态机等。

  2. Dart语法有些奇葩,但掌握之后,开发效率会很快,整个demo加起来开发了2天不到。

  3. 可以同时在android和ios运行。

  4. 性能很快,超过RN,因为没有bridge层。

  5. 还是要多看官方文档和源码,才能碰到问题解决。

  6. IDE还不是很友好,hot reload有时无效。

  7. 还是比RN要复杂一些的。

先上效果

flutter如何实现仿boss直聘功能

部署到手机

确保flutter正确安装之后,进入目录运行flutter run --release

环境问题

如果flutter环境有问题,在.bash_profile里加上如下内容

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

涉及技术点

1.Theme主题设置  

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: [
       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风格及一些组件应用

 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: [
      new Image.network(
       'https://img.bosszhipin.com/beijin/mcs/chatphoto/20170725/861159df793857d6cb984b52db4d4c9c.jpg',
       fit: BoxFit.cover,
       height: _appBarHeight,
      ),
     ],
    ),
   ),
  )

4.解决了官方demo里路由跳转效果卡顿的问题

Navigator.of(context).push(new PageRouteBuilder(
    opaque: false,
    pageBuilder: (BuildContext context, _, __) {
     return new CompanyDetail(company);
    },
    transitionsBuilder: (_, Animation animation, __, Widget child) {
     return new FadeTransition(
      opacity: animation,
      child: new SlideTransition(position: new Tween(
       begin: const Offset(0.0, 1.0),
       end: Offset.zero,
      ).animate(animation), child: child),
     );
    }
  ))

以上是“flutter如何实现仿boss直聘功能”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!


当前文章:flutter如何实现仿boss直聘功能
本文路径:http://cdkjz.cn/article/psdjpd.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220