22 lines
584 B
Dart
22 lines
584 B
Dart
import 'package:flutter/foundation.dart';
|
|
|
|
import 'gallery_item.dart';
|
|
|
|
/// Items the media gallery pages through. Sources that grow while the viewer
|
|
/// is open (chat history) notify; the viewer keeps the shown item in place.
|
|
abstract class GallerySource extends ChangeNotifier {
|
|
List<GalleryItem> get items;
|
|
|
|
bool get hasOlder => false;
|
|
|
|
/// Called when the user nears the start (oldest end) of [items].
|
|
Future<void> loadOlder() async {}
|
|
}
|
|
|
|
class StaticGallerySource extends GallerySource {
|
|
@override
|
|
final List<GalleryItem> items;
|
|
|
|
StaticGallerySource(this.items);
|
|
}
|