Flutter學(xué)習(xí)-備忘錄2

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(),
    );
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容