簡介:2年前,RN剛出來時作了個仿拉鉤的demo,react-native-lagou. 此次flutter來了,想感覺一下,索性用目前flutter的版本寫的一個仿boss直聘應用。 時間有限,沒徹底仿照,去掉了一些功能,可是界面風格一致,有參考價值。前端
確保flutter正確安裝以後,進入目錄運行flutter run --releasereact
若是flutter環境有問題,在.bash_profile里加上以下內容android
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),
);
}
));
複製代碼
微信:heruijun2258,註明來意。ios