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(),
|
db.matchDao.getAllMatches(),
|
||||||
Future.delayed(minimumSkeletonDuration),
|
Future.delayed(minimumSkeletonDuration),
|
||||||
]).then((results) {
|
]).then((results) {
|
||||||
final loadedMatches = results[0] as List<Match>;
|
|
||||||
matches = loadedMatches
|
|
||||||
..sort((a, b) => b.createdAt.compareTo(a.createdAt));
|
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
final loadedMatches = results[0] as List<Match>;
|
||||||
|
matches = loadedMatches
|
||||||
|
..sort((a, b) => b.createdAt.compareTo(a.createdAt));
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user