Fix iOS routing on a cold start (#62)

* Use relative socket paths instead of absolute paths

Replaced usage of absolute paths with relative socket file names for Unix domain sockets. This change simplifies socket file handling and may improve compatibility across different environments.

* Update temp directory usage for socket paths

Replaced getApplicationCacheDirectory with getTemporaryDirectory for app temp path. Updated socket file paths to use the correct temp directory, ensuring consistency and proper file placement across platforms.

* Revert "Update temp directory usage for socket paths"

This reverts commit 84c512c0c6.

* Log incoming route information from platform

Added a handler for PlatformDispatcher.onRouteInformationUpdated to log every incoming route or deeplink. This helps with debugging and tracking navigation events from the platform.

* Add RouteLogger to observe route information

Introduced a RouteLogger class implementing WidgetsBindingObserver to log incoming route information. Replaced the previous onRouteInformationUpdated handler with the observer pattern for improved route logging.

* Update flet dependency to deep-linking-fix branch

Changed the flet package override to use the 'deep-linking-fix' branch instead of 'main' for testing or applying fixes related to deep linking.

* Update deep linking bootstrap and flet dependency ref

Replaces manual route logging with FletDeepLinkingBootstrap.install() in main.dart for improved deep linking support. Updates the flet dependency git ref to 'deep-linking-fix-2' in pubspec.yaml.

* Update flet dependency to use main branch

Changed the flet dependency override from the 'deep-linking-fix-2' branch to the 'main' branch to track the latest stable updates.
This commit is contained in:
Feodor Fitsner 2025-12-22 21:28:01 -08:00 committed by GitHub
parent edaf215577
commit bbfc5c0cf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'dart:ui';
import 'package:flet/flet.dart'; import 'package:flet/flet.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
@ -67,6 +68,9 @@ String appDir = "";
Map<String, String> environmentVariables = {}; Map<String, String> environmentVariables = {};
void main(List<String> args) async { void main(List<String> args) async {
FletDeepLinkingBootstrap.install();
_args = List<String>.from(args); _args = List<String>.from(args);
var devPageUrl = const String.fromEnvironment("FLET_PAGE_URL"); var devPageUrl = const String.fromEnvironment("FLET_PAGE_URL");
@ -198,7 +202,7 @@ Future prepareApp() async {
environmentVariables["FLET_SERVER_PORT"] = tcpPort.toString(); environmentVariables["FLET_SERVER_PORT"] = tcpPort.toString();
} else { } else {
// use UDS on other platforms // use UDS on other platforms
pageUrl = path.join(appTempPath, "flet_$pid.sock"); pageUrl = "flet_$pid.sock";
environmentVariables["FLET_SERVER_UDS_PATH"] = pageUrl; environmentVariables["FLET_SERVER_UDS_PATH"] = pageUrl;
} }
} }
@ -227,7 +231,7 @@ Future<String?> runPythonApp(List<String> args) async {
'Python output TCP Server is listening on port ${outSocketServer.port}'); 'Python output TCP Server is listening on port ${outSocketServer.port}');
socketAddr = "$tcpAddr:${outSocketServer.port}"; socketAddr = "$tcpAddr:${outSocketServer.port}";
} else { } else {
socketAddr = path.join(environmentVariables["FLET_APP_STORAGE_TEMP"]!, "stdout_$pid.sock"); socketAddr = "stdout_$pid.sock";
if (await File(socketAddr).exists()) { if (await File(socketAddr).exists()) {
await File(socketAddr).delete(); await File(socketAddr).delete();
} }