Skip to content

Commit

Permalink
⚡ 优化列表性能
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoxieyoulei committed Apr 10, 2024
1 parent 9c02d53 commit 04aaa86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/common/widgets/two_dimension_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class _TwoDimensionListViewState extends State<TwoDimensionListView> {

Widget _buildRowList() {
return ListView.separated(
cacheExtent: 0,
controller: _verticalScrollController,
separatorBuilder: (context, index) => SizedBox(height: widget.gap.row),
itemCount: widget.itemCount.row + 1,
Expand All @@ -151,6 +152,7 @@ class _TwoDimensionListViewState extends State<TwoDimensionListView> {

Widget _buildColList({required int row}) {
return ListView.separated(
cacheExtent: 0,
controller: _position.row == row ? _horizontalScrollController : null,
scrollDirection: Axis.horizontal,
separatorBuilder: (context, index) => SizedBox(width: widget.gap.col),
Expand Down

0 comments on commit 04aaa86

Please sign in to comment.