Skip to content

Commit

Permalink
fix: open LiveView on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa committed Nov 6, 2023
1 parent 7319fa3 commit 286c1e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/l10n/app_pt.arb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"@@locale": "pt",
"welcome": "Bem vindo!",
"welcomeDescription": "Bem vindo ao Bluecherry Surveillance DVR!\nVamos conectar ao seu servidor DVR em un instante.",
"welcomeDescription": "Sea bem vindo ao Bluecherry Surveillance DVR!\nVamos conectar ao seu servidor DVR em um instante!",
"configure": "Configure um Servidor DVR",
"configureDescription": "Configure uma conexão com seu servidor DVR remoto",
"hostname": "Hostname",
Expand Down
20 changes: 12 additions & 8 deletions lib/utils/app_links.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'dart:io';

import 'package:app_links/app_links.dart';
import 'package:bluecherry_client/main.dart';
import 'package:bluecherry_client/utils/methods.dart';
import 'package:bluecherry_client/widgets/device_grid/device_grid.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:win32_registry/win32_registry.dart';

final instance = AppLinks();
Expand Down Expand Up @@ -48,13 +48,17 @@ Future<void> init() async {

void listen() {
instance.allUriLinkStream.listen((uri) {
final navigator = navigatorKey.currentState;
if (navigator == null) return;

debugPrint('Received URI: $uri');

final url = uri.toString();
final context = navigatorKey.currentContext!;
AddExternalStreamDialog.addStream(context, url);
if (isDesktopPlatform) {
final context = navigatorKey.currentContext;
if (context != null) {
AddExternalStreamDialog.addStream(context, url);
}
} else {
final navigator = navigatorKey.currentState;
if (navigator == null) return;
navigator.pushNamed('/rtsp', arguments: url);
}
});
}

0 comments on commit 286c1e8

Please sign in to comment.