mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 02:24:30 +00:00
fix: ios path fix
This commit is contained in:
parent
87ed25bd5b
commit
36cb3c2a69
1 changed files with 12 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
|
@ -2455,9 +2456,20 @@ class ThemeAssetsV3 implements IThemeAssets {
|
||||||
|
|
||||||
static String prependIfNeeded(String relativePath) {
|
static String prependIfNeeded(String relativePath) {
|
||||||
final path = StackFileSystem.themesDir!.path;
|
final path = StackFileSystem.themesDir!.path;
|
||||||
|
|
||||||
if (relativePath.startsWith(path)) {
|
if (relativePath.startsWith(path)) {
|
||||||
return relativePath;
|
return relativePath;
|
||||||
} else {
|
} 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";
|
return "$path/$relativePath";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue