From bbfc5c0cf57e6097f047c9515ea8e05cfca6a79a Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 22 Dec 2025 21:28:01 -0800 Subject: [PATCH] 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 84c512c0c6bc70e6564ba8ccc74784f0903cd0da. * 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. --- {{cookiecutter.out_dir}}/lib/main.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.out_dir}}/lib/main.dart b/{{cookiecutter.out_dir}}/lib/main.dart index 0c2f0f0..03ad94c 100644 --- a/{{cookiecutter.out_dir}}/lib/main.dart +++ b/{{cookiecutter.out_dir}}/lib/main.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:io'; +import 'dart:ui'; import 'package:flet/flet.dart'; import 'package:flutter/foundation.dart'; @@ -67,6 +68,9 @@ String appDir = ""; Map environmentVariables = {}; void main(List args) async { + + FletDeepLinkingBootstrap.install(); + _args = List.from(args); var devPageUrl = const String.fromEnvironment("FLET_PAGE_URL"); @@ -198,7 +202,7 @@ Future prepareApp() async { environmentVariables["FLET_SERVER_PORT"] = tcpPort.toString(); } else { // use UDS on other platforms - pageUrl = path.join(appTempPath, "flet_$pid.sock"); + pageUrl = "flet_$pid.sock"; environmentVariables["FLET_SERVER_UDS_PATH"] = pageUrl; } } @@ -227,7 +231,7 @@ Future runPythonApp(List args) async { 'Python output TCP Server is listening on port ${outSocketServer.port}'); socketAddr = "$tcpAddr:${outSocketServer.port}"; } else { - socketAddr = path.join(environmentVariables["FLET_APP_STORAGE_TEMP"]!, "stdout_$pid.sock"); + socketAddr = "stdout_$pid.sock"; if (await File(socketAddr).exists()) { await File(socketAddr).delete(); }