scroll animation

This commit is contained in:
zoe 2022-08-15 17:13:29 +02:00
parent f627f248fb
commit 4a712ffed4
2 changed files with 16 additions and 8 deletions

View File

@ -196,14 +196,23 @@ class TimelineState extends State<Timeline> with AutomaticKeepAliveClientMixin {
}
void reload() async {
setState(() {
children = [const LoadingBox()];
oldestId = null;
});
controller.animateTo(
0,
duration: const Duration(seconds: 1),
curve: Curves.easeOut,
);
if (mounted) {
setState(() {
children = [const LoadingBox()];
oldestId = null;
});
}
await _waitForFetchMore();
setState(() {
fetchMore();
});
if (mounted) {
setState(() {
fetchMore();
});
}
}
Future<void> _waitForFetchMore() async {

View File

@ -5,7 +5,6 @@ import 'package:loris/pages/chat/chat.dart';
import 'package:loris/pages/notifications/notifications.dart';
import 'package:loris/pages/timeline/timeline.dart';
import 'package:loris/pages/settings/settings.dart';
import '../global.dart' as global;
import '../business_logic/websocket.dart' as websocket;
import '../pages/timeline/timeline.dart' as tl;