2023-06-27 09:21:00 +00:00
|
|
|
import "package:flutter/material.dart";
|
|
|
|
|
|
|
|
class GalleryContextState extends InheritedWidget {
|
2023-08-01 13:30:31 +00:00
|
|
|
///Sorting by creation time
|
2023-06-27 09:21:00 +00:00
|
|
|
final bool sortOrderAsc;
|
2023-06-27 10:13:39 +00:00
|
|
|
final bool inSelectionMode;
|
2023-06-27 09:21:00 +00:00
|
|
|
|
|
|
|
const GalleryContextState({
|
2023-06-27 10:13:39 +00:00
|
|
|
this.inSelectionMode = false,
|
2023-06-27 09:21:00 +00:00
|
|
|
required this.sortOrderAsc,
|
|
|
|
required Widget child,
|
|
|
|
Key? key,
|
|
|
|
}) : super(key: key, child: child);
|
|
|
|
|
|
|
|
static GalleryContextState? of(BuildContext context) {
|
|
|
|
return context.dependOnInheritedWidgetOfExactType<GalleryContextState>();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool updateShouldNotify(GalleryContextState oldWidget) {
|
2023-06-27 10:13:39 +00:00
|
|
|
return sortOrderAsc != oldWidget.sortOrderAsc ||
|
|
|
|
inSelectionMode != oldWidget.inSelectionMode;
|
2023-06-27 09:21:00 +00:00
|
|
|
}
|
|
|
|
}
|