mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 15:30:40 +00:00
[mob][photos] Add hook to show cast devices
This commit is contained in:
parent
db95de8829
commit
f645fff31c
@ -105,5 +105,14 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSBonjourServices</key>
|
||||||
|
<array>
|
||||||
|
<string>_googlecast._tcp</string>
|
||||||
|
<string>F5BCEC64._googlecast._tcp</string>
|
||||||
|
</array>
|
||||||
|
|
||||||
|
<key>NSLocalNetworkUsageDescription</key>
|
||||||
|
<string>${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi
|
||||||
|
network.</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@ -2,6 +2,8 @@ import 'dart:async';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
|
import "package:cast/device.dart";
|
||||||
|
import "package:cast/discovery_service.dart";
|
||||||
import "package:flutter/cupertino.dart";
|
import "package:flutter/cupertino.dart";
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
@ -576,6 +578,9 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (widget.collection != null) {
|
||||||
|
actions.add(castWidget(context));
|
||||||
|
}
|
||||||
if (items.isNotEmpty) {
|
if (items.isNotEmpty) {
|
||||||
actions.add(
|
actions.add(
|
||||||
PopupMenuButton(
|
PopupMenuButton(
|
||||||
@ -642,6 +647,39 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
|
|||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget castWidget(BuildContext context) {
|
||||||
|
return FutureBuilder<List<CastDevice>>(
|
||||||
|
future: CastDiscoveryService().search(),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.hasError) {
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
'Error: ${snapshot.error.toString()}',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else if (!snapshot.hasData) {
|
||||||
|
return const Center(
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (snapshot.data!.isEmpty) {
|
||||||
|
return const Text('No device');
|
||||||
|
}
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: snapshot.data!.map((device) {
|
||||||
|
return Text(device.name);
|
||||||
|
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _connectToYourApp(
|
||||||
|
BuildContext contect, CastDevice device,) async {}
|
||||||
|
|
||||||
Future<void> onCleanUncategorizedClick(BuildContext buildContext) async {
|
Future<void> onCleanUncategorizedClick(BuildContext buildContext) async {
|
||||||
final actionResult = await showChoiceActionSheet(
|
final actionResult = await showChoiceActionSheet(
|
||||||
context,
|
context,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user