File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,14 @@ class FilePathExtractor {
15
15
final match = uriRegExp.firstMatch (stackTraceString);
16
16
17
17
if (match != null ) {
18
- final rawPath = match.group (1 )! ;
19
- final filePath = isWindows ? Uri .file (rawPath, windows: true ).toFilePath (windows: true ) : Uri .file (rawPath).toFilePath ();
20
- return filePath;
18
+ if (isWindows) {
19
+ final rawPath = match.group (1 )! ;
20
+ final filePath = Uri .file (rawPath, windows: true ).toFilePath (windows: true );
21
+ return filePath;
22
+ } else {
23
+ final filePath = Uri .tryParse ('file:///${match .group (1 )!}' );
24
+ return filePath! .toFilePath ();
25
+ }
21
26
} else {
22
27
throw FileNotFoundException (
23
28
message: 'File not found in stack trace' ,
@@ -32,5 +37,5 @@ class FilePathExtractor {
32
37
static bool isWindows = Platform .isWindows;
33
38
34
39
static const String _windowsPattern = r'file:///([a-zA-Z]:/[^:\s]+)' ;
35
- static const String _linuxMacOSPattern = r'file:// /([^:\s ]+)' ;
40
+ static const String _linuxMacOSPattern = r'file:\/\/\ /([^\s: ]+)' ;
36
41
}
You can’t perform that action at this time.
0 commit comments