From eb1e1460bf8e026dfc7456ef653a7c107a4c6696 Mon Sep 17 00:00:00 2001 From: Paul Fauchon Date: Fri, 17 Feb 2023 23:44:26 +0800 Subject: [PATCH] mall fix for videolist --- lib/views/videoList.dart | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/lib/views/videoList.dart b/lib/views/videoList.dart index dbc019dc..59d207d0 100644 --- a/lib/views/videoList.dart +++ b/lib/views/videoList.dart @@ -1,19 +1,15 @@ import 'dart:async'; -import 'package:fbroadcast/fbroadcast.dart'; -import 'package:flutter/foundation.dart'; -import 'package:intl/intl.dart'; -import 'package:flutter/cupertino.dart'; +import 'package:after_layout/after_layout.dart'; +import 'package:fbroadcast/fbroadcast.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_fadein/flutter_fadein.dart'; import 'package:invidious/utils.dart'; -import 'package:invidious/views/video.dart'; - -import 'package:after_layout/after_layout.dart'; import 'package:invidious/views/videoList/singleVideo.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; + import '../globals.dart'; import '../models/videoInList.dart'; -import 'package:flutter_fadein/flutter_fadein.dart'; class VideoList extends StatefulWidget { Future> Function()? getVideos; @@ -129,11 +125,11 @@ class VideoListState extends State with AfterLayoutMixin { } loadVideo(Future> Function() refreshFunction) async { - setState(() { - error = ''; - loading = true; - }); if (widget.getVideos != null) { + setState(() { + error = ''; + loading = true; + }); try { var videos = await refreshFunction(); setState(() { @@ -147,9 +143,8 @@ class VideoListState extends State with AfterLayoutMixin { error = 'Couldn\'t fetch videos, tap to try again'; }); } + refreshController.refreshCompleted(); } - - refreshController.refreshCompleted(); } @override