flutter實(shí)現(xiàn)仿boss直聘功能
Flutter是Google使用Dart語言開發(fā)的移動(dòng)應(yīng)用開發(fā)框架,使用一套Dart代碼就能構(gòu)建高性能、高保真的iOS和Android應(yīng)用程序,并且在排版、圖標(biāo)、滾動(dòng)、點(diǎn)擊等方面實(shí)現(xiàn)零差異。
2年前,RN剛出來時(shí)做了個(gè)仿拉鉤的demo,react-native-lagou.
這次flutter來了,想感受一下,索性用目前flutter的版本寫的一個(gè)仿boss直聘應(yīng)用。
時(shí)間有限,沒完全仿照,去掉了一些功能,但是界面風(fēng)格一致,有參考價(jià)值。
github地址:flutter仿boss直聘.
感悟
- 與一些文章里介紹的非常相似,如果會(huì)RN,那么學(xué)起來會(huì)很快,flutter借鑒了RN的組件化思想,路由機(jī)制,狀態(tài)機(jī)等。
- Dart語法有些奇葩,但掌握之后,開發(fā)效率會(huì)很快,整個(gè)demo加起來開發(fā)了2天不到。
- 可以同時(shí)在android和ios運(yùn)行。
- 性能很快,超過RN,因?yàn)闆]有bridge層。
- 還是要多看官方文檔和源碼,才能碰到問題解決。
- IDE還不是很友好,hot reload有時(shí)無效。
- 還是比RN要復(fù)雜一些的。
先上效果

部署到手機(jī)
確保flutter正確安裝之后,進(jìn)入目錄運(yùn)行flutter run --release
環(huán)境問題
如果flutter環(huán)境有問題,在.bash_profile里加上如下內(nèi)容
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
涉及技術(shù)點(diǎn)
1.Theme主題設(shè)置
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: <Widget>[
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風(fēng)格及一些組件應(yīng)用
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,
),
],
),
),
)
4.解決了官方demo里路由跳轉(zhuǎn)效果卡頓的問題
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
- 下拉篩選組件
- mock server,模擬真實(shí)請(qǐng)求
- 分頁
- 目錄結(jié)構(gòu)調(diào)整,更符合生產(chǎn)環(huán)境
- viewpager輪播圖
- 路由機(jī)制封裝
總結(jié)
以上所述是小編給大家介紹的flutter實(shí)現(xiàn)仿boss直聘,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
- Flutter Android端啟動(dòng)白屏問題的解決
- Flutter啟動(dòng)頁(閃屏頁)的具體實(shí)現(xiàn)及原理詳析
- Flutter進(jìn)階之實(shí)現(xiàn)動(dòng)畫效果(一)
- Flutter中ListView 的使用示例
- Flutter質(zhì)感設(shè)計(jì)之彈出菜單
- Flutter實(shí)現(xiàn)底部導(dǎo)航欄效果
- Flutter路由的跳轉(zhuǎn)、動(dòng)畫和傳參詳解(最簡單)
- Flutter實(shí)現(xiàn)頁面切換后保持原頁面狀態(tài)的3種方法
- Flutter質(zhì)感設(shè)計(jì)之進(jìn)度條
- Flutter啟動(dòng)流程的深入解析
相關(guān)文章
Android實(shí)現(xiàn)捕獲未知異常并提交給服務(wù)器的方法
這篇文章主要介紹了Android實(shí)現(xiàn)捕獲未知異常并提交給服務(wù)器的方法,涉及Android的異常與錯(cuò)誤處理機(jī)制相關(guān)操作技巧,需要的朋友可以參考下2016-08-08
Android仿微信朋友圈全文、收起功能的實(shí)例代碼
本篇文章主要介紹了Android仿微信朋友圈全文、收起功能的實(shí)例代碼,具有一定的參考價(jià)值,有興趣的可以了解一下2017-08-08
分享10個(gè)很棒的學(xué)習(xí)Android開發(fā)的網(wǎng)站
我推薦的網(wǎng)站,都是我在學(xué)習(xí)Android 開發(fā)過程中發(fā)現(xiàn)的好網(wǎng)站,給初學(xué)者一些建議,少走一些彎路2015-03-03
android隱式意圖激活瀏覽器的實(shí)現(xiàn)方法
下面小編就為大家?guī)硪黄猘ndroid隱式意圖激活瀏覽器的實(shí)現(xiàn)方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-06-06
android實(shí)現(xiàn)簡單底部導(dǎo)航欄
這篇文章主要為大家詳細(xì)介紹了android實(shí)現(xiàn)簡單底部導(dǎo)航欄,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-07-07
Android編程使用Service實(shí)現(xiàn)Notification定時(shí)發(fā)送功能示例
這篇文章主要介紹了Android編程使用Service實(shí)現(xiàn)Notification定時(shí)發(fā)送功能,涉及Android服務(wù)Service控制通知的發(fā)送功能相關(guān)操作技巧,需要的朋友可以參考下2017-08-08

