feat: enhance deep link handling for install extensions (#1249)

This commit is contained in:
Levi authored and GitHub committed 2026-01-21 20:23:04 +08:00
1 parent d90af0b9d1
commit af1c8b2719
7 files changed
+77 -51

No files matched your search

@@ -20,6 +20,9 @@ class CreateController extends GetxController
final oldUrl = "".obs;
final fileDataUri = "".obs;
/// Flag to prevent handling pending create task from deep link multiple times
bool pendingCreateHandled = false;
@override
void onInit() {
super.onInit();
@@ -82,17 +82,16 @@ class CreateView extends GetView<CreateController> {
_pathController.text = renderPathPlaceholders(downloadDir);
}
// Initialize archive settings from global config if not already set
if (_autoExtractController.value == null) {
_autoExtractController.value =
appController.downloaderConfig.value.archive.autoExtract;
}
if (_deleteAfterExtractController.value == null) {
_deleteAfterExtractController.value =
appController.downloaderConfig.value.archive.deleteAfterExtract;
}
_autoExtractController.value ??=
appController.downloaderConfig.value.archive.autoExtract;
_deleteAfterExtractController.value ??=
appController.downloaderConfig.value.archive.deleteAfterExtract;
// Handle pending create task from deep link
final CreateTask? routerParams = Get.rootDelegate.arguments();
if (routerParams?.req?.url.isNotEmpty ?? false) {
if ((routerParams?.req?.url.isNotEmpty ?? false) &&
!controller.pendingCreateHandled) {
controller.pendingCreateHandled = true;
// get url from route arguments
final url = routerParams!.req!.url;
_urlController.text = url;