mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-29 22:00:16 +08:00
opt: mapIndexed
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:PiliPlus/pages/live_dm_block/controller.dart';
|
||||
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
||||
import 'package:PiliPlus/utils/extension/size_ext.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart' show FilteringTextInputFormatter;
|
||||
@@ -168,15 +169,14 @@ class _LiveDmBlockPageState extends State<LiveDmBlockPage> {
|
||||
child: Wrap(
|
||||
spacing: 12,
|
||||
runSpacing: 12,
|
||||
children: list.indexed.map(
|
||||
(e) {
|
||||
final item = e.$2;
|
||||
children: list.mapIndexed(
|
||||
(i, e) {
|
||||
return SearchText(
|
||||
text: item is ShieldUserList ? item.uname! : item as String,
|
||||
text: e is ShieldUserList ? e.uname! : e as String,
|
||||
onTap: (value) => showConfirmDialog(
|
||||
context: context,
|
||||
title: const Text('确定删除该规则?'),
|
||||
onConfirm: () => _controller.onRemove(e.$1, item),
|
||||
onConfirm: () => _controller.onRemove(i, e),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user