我希望每個用戶都堆疊在一起,如圖所示整潔如何讓用戶分配看起來堆疊?我想要這樣:
記得仔細計算距離。我使用
Positioned并計算left distance = (WIDTH - 30) * index. 它有點像你的影像,只需調整一些東西,然后就可以了。祝你好運!uj5u.com熱心網友回復:
這就是我通常做這樣的堆疊小部件的方式。試試看
Stack( clipBehavior: Clip.none, children: [ for (var i = 0; i < yourList.length; i ) Container( //* you can adjust the margin here base on your desired output margin: EdgeInsets.only(left: 12 * i.toDouble()), child: ClipRRect( borderRadius: BorderRadius.circular(8), child: Image.asset( 'asset/img/profile_photo.png', width: 40, height: 40, ), ), ), ]),轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/520022.html
標籤:扑用户界面

