π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Finish auto-pair integration
Neeraj Gupta4b97f832b2a1
diff --git a/mobile/lib/ui/cast/auto.dart b/mobile/lib/ui/cast/auto.dartindex 0b088a9d2d..8afacf7db7 100644--- a/mobile/lib/ui/cast/auto.dart+++ b/mobile/lib/ui/cast/auto.dart@@ -1,5 +1,6 @@import "dart:io";+import "package:ente_cast/ente_cast.dart";import "package:flutter/material.dart";import "package:photos/generated/l10n.dart";import "package:photos/service_locator.dart";@@ -8,7 +9,11 @@ import "package:photos/ui/common/loading_widget.dart";import "package:photos/utils/dialog_util.dart";class AutoCastDialog extends StatefulWidget {- AutoCastDialog({+ // async method that takes string as input+ // and returns void+ final void Function(String) onConnect;+ AutoCastDialog(+ this.onConnect, {Key? key,}) : super(key: key) {}@@ -88,6 +93,16 @@ class _AutoCastDialogState extends State<AutoCastDialog> {BuildContext context,Object castDevice,) async {- await castService.connectDevice(context, castDevice);+ await castService.connectDevice(+ context,+ castDevice,+ onMessage: (message) {+ if (message.containsKey(CastMessageType.pairCode)) {+ final code = message[CastMessageType.pairCode]!['code'];+ widget.onConnect(code);+ // Navigator.of(context).pop();+ }+ },+ );}}diff --git a/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dartindex d73662e19f..4365b78130 100644--- a/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart+++ b/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart@@ -875,7 +875,11 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {context: context,barrierDismissible: true,builder: (BuildContext context) {- return AutoCastDialog();+ return AutoCastDialog(+ (device) async {+ await _castPair(gw, device);+ },+ );},);}