π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Assert that SelectionState inherited widget is in context or not
ashilknf001812a1d28
diff --git a/mobile/lib/ui/viewer/gallery/state/selection_state.dart b/mobile/lib/ui/viewer/gallery/state/selection_state.dartindex fa2fdfa171..a67ffd449f 100644--- a/mobile/lib/ui/viewer/gallery/state/selection_state.dart+++ b/mobile/lib/ui/viewer/gallery/state/selection_state.dart@@ -18,10 +18,16 @@ class SelectionState extends InheritedWidget {required Widget child,}) : super(key: key, child: child);- static SelectionState? of(BuildContext context) {+ static SelectionState? maybeOf(BuildContext context) {return context.dependOnInheritedWidgetOfExactType<SelectionState>();}+ static SelectionState of(BuildContext context) {+ final SelectionState? result = maybeOf(context);+ assert(result != null, 'No SelectionState found in context');+ return result!;+ }+@overridebool updateShouldNotify(covariant InheritedWidget oldWidget) {return false;