opt: code

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-13 10:55:05 +08:00
parent be371e002a
commit 94d055610e
5 changed files with 8 additions and 10 deletions

View File

@@ -93,7 +93,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
_quality =
GStorage.setting.get(SettingBoxKey.previewQuality, defaultValue: 80);
_thumbList = List.generate(widget.sources.length, (_) => true);
_thumbList = List.filled(widget.sources.length, true);
_pageController = PageController(initialPage: widget.initIndex);

View File

@@ -71,12 +71,10 @@ class _ListSheetContentState extends State<ListSheetContent>
});
}
itemScrollController = _isList
? List.generate(
widget.season.sections.length, (_) => ItemScrollController())
? List.filled(widget.season.sections.length, ItemScrollController())
: [ItemScrollController()];
reverse = _isList
? List.generate(widget.season.sections.length, (_) => false)
: [false];
reverse =
_isList ? List.filled(widget.season.sections.length, false) : [false];
WidgetsBinding.instance.addPostFrameCallback((_) {
itemScrollController[_index].jumpTo(index: currentIndex);
});

View File

@@ -579,7 +579,7 @@ class _ReportPanelState extends State<ReportPanel> {
},
['头像违规', '昵称违规', '签名违规'][index],
),
).toList(),
),
const Text('举报理由(单选,非必选)'),
...List.generate(
5,
@@ -591,7 +591,7 @@ class _ReportPanelState extends State<ReportPanel> {
},
['色情低俗', '不实信息', '违禁', '人身攻击', '赌博诈骗'][index],
),
).toList(),
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.end,

View File

@@ -3,7 +3,7 @@ import 'package:get/get.dart';
class SearchResultController extends GetxController {
String? keyword;
RxList<int> count = List.generate(5, (_) => -1).toList().obs;
RxList<int> count = List.filled(5, -1).toList().obs;
@override
void onInit() {

View File

@@ -55,7 +55,7 @@ class GStorage {
static List<Color> get blockColor {
List list = setting.get(
SettingBoxKey.blockColor,
defaultValue: List.generate(SegmentType.values.length, (_) => ''),
defaultValue: List.filled(SegmentType.values.length, ''),
);
return SegmentType.values
.map((item) => list[item.index].isNotEmpty