按照給定尺寸進(jìn)行圖片的解碼,而不是解碼整個(gè)圖片的尺寸,用來(lái)減少內(nèi)存的占用。
創(chuàng)新互聯(lián)專注于淮濱企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè)公司,商城網(wǎng)站開發(fā)?;礊I網(wǎng)站建設(shè)公司,為淮濱等地區(qū)提供建站服務(wù)。全流程按需制作網(wǎng)站,專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù)
官方文檔:
官方說(shuō)明:
Instructs Flutter to decode the image at the specified dimensions instead of at its native size.
This allows finer control of the size of the image in ImageCache and is generally used to reduce the memory footprint of ImageCache .
The decoded image may still be displayed at sizes other than the cached size provided here.
使用:
三方庫(kù): cached_network_image 限2.5.0之后版本才可用
設(shè)定最大的緩存寬度和高度 this.maxWidthDiskCache 、 this.maxHeightDiskCache
使用:
從相冊(cè)選取圖片,展示時(shí)使用指定尺寸寬高進(jìn)行處理。
使用三方庫(kù):
使用自定義 provider 來(lái)指定所需圖片的寬高:
AssetEntityImageProvider 傳入寬高和圖片原圖 AssetEntity 數(shù)據(jù)。
provider 中 key.entity.thumbDataWithSize 方法:
進(jìn)入 entity 中 thumbDataWithSize 方法:
進(jìn)入 _getThumbDataWithId 方法中,
進(jìn)入getThumb:
調(diào)用iOS原生的獲取圖片方法,
進(jìn)入 getThumbWithId 方法,
原生實(shí)現(xiàn)獲取置頂寬高縮略圖方法實(shí)現(xiàn):
使用 iOS 原生類 PHImageManager 的
來(lái)獲取縮略圖。
文章名稱:flutter置頂,flutter常見(jiàn)問(wèn)題
分享鏈接:http://aaarwkj.com/article24/dssjdce.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、網(wǎng)站制作、品牌網(wǎng)站設(shè)計(jì)、ChatGPT、網(wǎng)站設(shè)計(jì)公司、移動(dòng)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)