opt: mapIndexed

This commit is contained in:
My-Responsitories
2026-06-23 18:15:44 +08:00
parent 9660d74a80
commit 9d6d3d524c
7 changed files with 54 additions and 53 deletions

View File

@@ -1,5 +1,6 @@
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
import 'package:PiliPlus/models/model_owner.dart';
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
Widget avatars({
@@ -28,19 +29,19 @@ Widget avatars({
width: offset * users.length + gap,
child: Stack(
clipBehavior: .none,
children: users.indexed
.map(
(e) => Positioned(
children: users
.mapIndexed(
(i, e) => Positioned(
top: 0,
bottom: 0,
width: size,
left: e.$1 * offset,
left: i * offset,
child: DecoratedBox(
decoration: decoration,
child: Padding(
padding: const .all(padding),
child: NetworkImgLayer(
src: e.$2.face,
src: e.face,
width: imgSize,
height: imgSize,
type: .avatar,