简介:2年前,RN刚出来时做了个仿拉钩的demo,react-native-lagou. 这次flutter来了,想感受一下,索性用目前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
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: <Widget>[
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: <Widget>[
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: (_, 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),
);
}
));