fix: ios path fix

This commit is contained in:
julian 2023-07-03 18:46:58 -06:00
parent 87ed25bd5b
commit 36cb3c2a69

View file

@ -9,6 +9,7 @@
*/
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:isar/isar.dart';
@ -2455,9 +2456,20 @@ class ThemeAssetsV3 implements IThemeAssets {
static String prependIfNeeded(String relativePath) {
final path = StackFileSystem.themesDir!.path;
if (relativePath.startsWith(path)) {
return relativePath;
} else {
if (Platform.isIOS) {
const pattern = "/var/mobile/Containers/Data/Application/";
if (relativePath.startsWith(pattern)) {
final parts = relativePath.split("/Library/themes/");
if (parts.isNotEmpty) {
return "$path/${parts.last}";
}
}
}
return "$path/$relativePath";
}
}