本文共 3081 字,大约阅读时间需要 10 分钟。
简介:2年前,RN刚出来时做了个仿拉钩的demo,. 这次flutter来了,想感受一下,索性用目前flutter的版本写的一个仿boss直聘应用。 时间有限,没完全仿照,去掉了一些功能,但是界面风格一致,有参考价值。
确保flutter正确安装之后,进入目录运行flutter run --release
如果flutter环境有问题,在.bash_profile里加上如下内容
export PUB_HOSTED_URL=https://pub.flutter-io.cnexport FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cnexport PATH=`pwd`/flutter/bin:$PATH复制代码
theme: new ThemeData( primaryIconTheme: const IconThemeData(color: Colors.white), brightness: Brightness.light, primaryColor: new Color.fromARGB(255, 0, 215, 198), accentColor: Colors.cyan[300], )复制代码
@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() ] ); }复制代码
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, ), ], ), ), )复制代码
Navigator.of(context).push(new PageRouteBuilder( opaque: false, pageBuilder: (BuildContext context, _, __) { return new CompanyDetail(company); }, transitionsBuilder: (_, Animationanimation, __, 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), ); } ));复制代码