Skip to content

Commit d289cde

Browse files
committed
fix: ios path fix
(cherry picked from commit 36cb3c2)
1 parent c5a3cf9 commit d289cde

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lib/models/isar/stack_theme.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:convert';
2+
import 'dart:io';
23

34
import 'package:flutter/material.dart';
45
import 'package:isar/isar.dart';
@@ -2444,9 +2445,20 @@ class ThemeAssetsV3 implements IThemeAssets {
24442445

24452446
static String prependIfNeeded(String relativePath) {
24462447
final path = StackFileSystem.themesDir!.path;
2448+
24472449
if (relativePath.startsWith(path)) {
24482450
return relativePath;
24492451
} else {
2452+
if (Platform.isIOS) {
2453+
const pattern = "/var/mobile/Containers/Data/Application/";
2454+
if (relativePath.startsWith(pattern)) {
2455+
final parts = relativePath.split("/Library/themes/");
2456+
if (parts.isNotEmpty) {
2457+
return "$path/${parts.last}";
2458+
}
2459+
}
2460+
}
2461+
24502462
return "$path/$relativePath";
24512463
}
24522464
}

0 commit comments

Comments
 (0)