1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Get older messages

This commit is contained in:
2019-04-27 18:29:30 +02:00
parent b02315cf09
commit d6e5b668cc
4 changed files with 170 additions and 29 deletions

View File

@ -0,0 +1,27 @@
import 'package:flutter/material.dart';
/// Scroll watcher
///
/// @author Pierre HUBERT
typedef OnReachBottomCallback = void Function();
class ScrollWatcher extends ScrollController {
// Callbacks
OnReachBottomCallback onReachBottom;
ScrollWatcher({this.onReachBottom}) {
addListener(_updatePosition);
}
void _updatePosition() {
// Refresh bottom position
if(position.pixels.floor() == position.maxScrollExtent.floor())
onReachBottom();
}
}