Git Product home page Git Product logo

flutter_boss's Introduction

flutter版本仿boss直聘

简介:2年前,RN刚出来时做了个仿拉钩的demo,react-native-lagou. 这次flutter来了,想感受一下,索性用目前flutter的版本写的一个仿boss直聘应用。 时间有限,没完全仿照,去掉了一些功能,但是界面风格一致,有参考价值。 QQ技术交流群:468010872

感悟

  1. 与一些文章里介绍的非常相似,如果会RN,那么学起来会很快,flutter借鉴了RN的组件化**,路由机制,状态机等。
  2. Dart语法有些奇葩,但掌握之后,开发效率会很快,整个demo加起来开发了2天不到。
  3. 可以同时在android和ios运行。
  4. 性能很快,超过RN,因为没有bridge层。
  5. 还是要多看官方文档和源码,才能碰到问题解决。
  6. IDE还不是很友好,hot reload有时无效。
  7. 还是比RN要复杂一些的。

先上效果

img

环境问题

如果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],
      )
  1. 自定义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()
            ]
        );
      }
  1. 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: <Widget>[
            new Image.network(
              'https://img.bosszhipin.com/beijin/mcs/chatphoto/20170725/861159df793857d6cb984b52db4d4c9c.jpg',
              fit: BoxFit.cover,
              height: _appBarHeight,
            ),
          ],
        ),
      ),
    )
  1. 解决了官方demo里路由跳转效果卡顿的问题
    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,模拟真实请求
  3. 分页
  4. 目录结构调整,更符合生产环境
  5. viewpager轮播图
  6. 路由机制封装

联系方式

微信:heruijun2258,注明来意。

flutter_boss's People

Contributors

daiwj avatar hrj8848 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.