1.FadeInImage實(shí)現(xiàn)圖片占位圖
/// 透明漸顯,需要transparent_image插件
FadeInImage.memoryNetwork(
placeholder:kTransparentImage,
image:'http://www.a.com/a.png'
)
/// 本地占位圖
FadeInImage.assetNetwork(
placeholder:'assets/a.gif',
image:'http://www.a.com/a.png'
)
2.cached_network_image插件實(shí)現(xiàn)網(wǎng)絡(luò)圖片緩存
CachedNetworkImage(
placeholder:(context,url) => new CirularProgressIndicator(),
imageUrl:'http://www.a.com/a.png'
)
3.AnimatedWidget 和AnimatedBuilder 進(jìn)行動(dòng)畫封裝簡(jiǎn)化
4.hero動(dòng)畫實(shí)現(xiàn)頁面過渡
tag:關(guān)聯(lián)兩個(gè)hero動(dòng)畫標(biāo)識(shí)
createRectTween: 定義目標(biāo)hero邊界,在從起始位置到目標(biāo)位置的飛行過程中該如何變化
5.PageView實(shí)現(xiàn)頁面滾動(dòng)
6.flutter_swiper 插件實(shí)現(xiàn)輪播圖
7.MediaQuery.removePadding(removeTop:true,context:context,child: ListView(...)), 實(shí)現(xiàn)移除列表頂部預(yù)留
8.NotificationListener(),監(jiān)聽列表滾動(dòng), scrollNotification.depath == 0 ,代表第0個(gè)子元素
9.Opacity(opacity:1 child:xxx) ,實(shí)現(xiàn)改變子元素透明度
10.Future 中 timeout 可以實(shí)現(xiàn)超時(shí)效果處理
11.ExpansionTile 實(shí)現(xiàn)展開收起效果
12.數(shù)組復(fù)制:b = List<String>.from(a);
13.fultter create -t module xxx_module 執(zhí)行時(shí)會(huì)創(chuàng)建原生中flutter模塊
14.FractionallySizeBox 實(shí)現(xiàn)child布局,widthFactor:1寬度撐滿屏幕
15.PhysicalModel 實(shí)現(xiàn)圓角
PhysicalModel(
color: Colors.transparent,
borderRadius: BorderRadius.circular(6),
clipBehavior: Clip.antiAlias,
child: Container(),
);