Skip to content

Commit

Permalink
异步添加文章
Browse files Browse the repository at this point in the history
  • Loading branch information
Muska-Ami committed Aug 28, 2024
1 parent cd96981 commit daccefe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ui/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ class _HomeController extends GetxController {
// print('${b['item'].title} $bTime, ${a['item'].title} $aTime, RES: $result');
return result;
});
allParagraph.value = dataParagraph;
allParagraph.clear();
// 使用异步方法添加文章,避免大量文章导致UI卡顿
dataParagraph.forEach((item) async {
allParagraph.add(item);
allParagraph.refresh();
});
}
}

0 comments on commit daccefe

Please sign in to comment.