Ejemplo n.º 1
0
        Widget _buildLeaderBoardItem(BuildContext context, int index)
        {
            var collectionId = this.data[index : index];
            var rankData     = this.rankDict.ContainsKey(key: collectionId)
                ? this.rankDict[key : collectionId]
                               : new RankData();
            var favoriteTag = this.favoriteTagDict.ContainsKey(key: rankData.itemId)
                ? this.favoriteTagDict[key : rankData.itemId]
                              : new FavoriteTag();

            return(new GestureDetector(
                       onTap: () => this.onPressItem?.Invoke(text: rankData.id),
                       child: new Container(
                           width: 160,
                           height: 80,
                           margin: EdgeInsets.only(index == 0 ? 16 : 0, right: 16),
                           decoration: new BoxDecoration(
                               borderRadius: BorderRadius.all(4)
                               ),
                           child: new ClipRRect(
                               borderRadius: BorderRadius.all(4),
                               child: new Stack(
                                   children: new List <Widget> {
                Positioned.fill(
                    new Container(color: CColorUtils.GetCardColorFromId(id: collectionId))
                    ),
                Image.asset(
                    CImageUtils.GetSpecificPatternImageNameFromId(id: collectionId),
                    width: 160,
                    height: 80,
                    fit: BoxFit.fill
                    ),
                Positioned.fill(
                    new Padding(
                        padding: EdgeInsets.all(16),
                        child: new Text(
                            rankData.resetTitle.isNotEmpty() ? rankData.resetTitle : favoriteTag.name,
                            maxLines: 2,
                            overflow: TextOverflow.ellipsis,
                            style: CTextStyle.PLargeMediumWhite
                            )
                        )
                    )
            }
                                   )
                               )
                           )
                       ));
        }