mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-06 02:54:49 +08:00
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/avatars.dart';
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
import 'package:PiliPlus/common/widgets/dialog/report.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
@@ -149,51 +150,6 @@ class _VotePanelState extends State<VotePanel> {
|
||||
Obx(() {
|
||||
final list = followeeVote.value;
|
||||
if (list != null && list.isNotEmpty) {
|
||||
Widget child;
|
||||
const size = 22.0;
|
||||
const gap = 6.0;
|
||||
const offset = size - gap;
|
||||
if (list.length == 1) {
|
||||
child = NetworkImgLayer(
|
||||
src: list.first.face,
|
||||
width: size,
|
||||
height: size,
|
||||
);
|
||||
} else {
|
||||
final decoration = BoxDecoration(
|
||||
shape: .circle,
|
||||
border: Border.all(color: theme.colorScheme.surface),
|
||||
);
|
||||
child = SizedBox(
|
||||
height: size,
|
||||
width: offset * min(3, list.length) + gap,
|
||||
child: Stack(
|
||||
clipBehavior: .none,
|
||||
children: list
|
||||
.take(3)
|
||||
.indexed
|
||||
.map(
|
||||
(e) => Positioned(
|
||||
top: 0,
|
||||
left: e.$1 * offset,
|
||||
bottom: 0,
|
||||
child: DecoratedBox(
|
||||
decoration: decoration,
|
||||
child: Padding(
|
||||
padding: const .all(.8),
|
||||
child: NetworkImgLayer(
|
||||
src: e.$2.face,
|
||||
width: size - .8,
|
||||
height: size - .8,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
return GestureDetector(
|
||||
behavior: .opaque,
|
||||
onTap: () {
|
||||
@@ -213,7 +169,7 @@ class _VotePanelState extends State<VotePanel> {
|
||||
(e) => ListTile(
|
||||
dense: true,
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${e.uid}'),
|
||||
Get.toNamed('/member?mid=${e.mid}'),
|
||||
leading: NetworkImgLayer(
|
||||
src: e.face,
|
||||
width: 40,
|
||||
@@ -259,7 +215,10 @@ class _VotePanelState extends State<VotePanel> {
|
||||
child: Row(
|
||||
mainAxisSize: .min,
|
||||
children: [
|
||||
child,
|
||||
avatars(
|
||||
colorScheme: theme.colorScheme,
|
||||
users: list.take(3),
|
||||
),
|
||||
Icon(
|
||||
size: 18,
|
||||
color: theme.colorScheme.outline.withValues(alpha: .7),
|
||||
|
||||
Reference in New Issue
Block a user