[mob][photos] Extract strings

This commit is contained in:
Neeraj Gupta 2024-04-29 16:45:43 +05:30
parent 16888c8aad
commit 7c9160478d
6 changed files with 31 additions and 10 deletions

View file

@ -1342,6 +1342,10 @@ class MessageLookup extends MessageLookupByLibrary {
"sparkleSuccess": MessageLookupByLibrary.simpleMessage("✨ Success"),
"startBackup": MessageLookupByLibrary.simpleMessage("Start backup"),
"status": MessageLookupByLibrary.simpleMessage("Status"),
"stopCastingBody": MessageLookupByLibrary.simpleMessage(
"Do you want to stop casting?"),
"stopCastingTitle":
MessageLookupByLibrary.simpleMessage("Stop casting"),
"storage": MessageLookupByLibrary.simpleMessage("Storage"),
"storageBreakupFamily": MessageLookupByLibrary.simpleMessage("Family"),
"storageBreakupYou": MessageLookupByLibrary.simpleMessage("You"),

View file

@ -8643,6 +8643,26 @@ class S {
args: [],
);
}
/// `Stop casting`
String get stopCastingTitle {
return Intl.message(
'Stop casting',
name: 'stopCastingTitle',
desc: '',
args: [],
);
}
/// `Do you want to stop casting?`
String get stopCastingBody {
return Intl.message(
'Do you want to stop casting?',
name: 'stopCastingBody',
desc: '',
args: [],
);
}
}
class AppLocalizationDelegate extends LocalizationsDelegate<S> {

View file

@ -1220,5 +1220,7 @@
"connectToDevice": "Connect to device",
"autoCastDialogBody": "You'll see available Cast devices here.",
"autoCastiOSPermission": "Make sure Local Network permissions are turned on for the Ente Photos app, in Settings.",
"noDeviceFound": "No device found"
"noDeviceFound": "No device found",
"stopCastingTitle": "Stop casting",
"stopCastingBody": "Do you want to stop casting?"
}

View file

@ -113,8 +113,6 @@ class _AutoCastDialogState extends State<AutoCastDialog> {
BuildContext context,
Object castDevice,
) async {
// sleep for 10 seconds
await Future.delayed(const Duration(seconds: 10));
await castService.connectDevice(
context,
castDevice,

View file

@ -863,10 +863,10 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
if (castService.getActiveSessions().isNotEmpty) {
await showChoiceDialog(
context,
title: "Stop casting",
firstButtonLabel: "Yes",
secondButtonLabel: "No",
body: "Do you want to stop casting?",
title: S.of(context).stopCastingTitle,
firstButtonLabel: S.of(context).yes,
secondButtonLabel: S.of(context).no,
body: S.of(context).stopCastingBody,
firstButtonOnTap: () async {
gw.revokeAllTokens().ignore();
await castService.closeActiveCasts();
@ -884,7 +884,6 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
return const CastChooseDialog();
},
);
_logger.info("Cast result: $result");
if (result == null) {
return;
}

View file

@ -39,8 +39,6 @@ class CastServiceImpl extends CastService {
session.stateStream.listen((state) {
if (state == CastSessionState.connected) {
const snackBar = SnackBar(content: Text('Connected'));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
debugPrint("Send request to pair");
session.sendMessage(_pairRequestNamespace, {});
} else if (state == CastSessionState.closed) {