move setState to include match loading and sorting in MatchView
This commit is contained in:
@@ -119,11 +119,11 @@ class _MatchViewState extends State<MatchView> {
|
||||
db.matchDao.getAllMatches(),
|
||||
Future.delayed(minimumSkeletonDuration),
|
||||
]).then((results) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
final loadedMatches = results[0] as List<Match>;
|
||||
matches = loadedMatches
|
||||
..sort((a, b) => b.createdAt.compareTo(a.createdAt));
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user