Last active
July 18, 2019 12:23
-
-
Save tearf001/ca85d8a089f27428c77bbf49fb906fb5 to your computer and use it in GitHub Desktop.
Revisions
-
WangXinhai revised this gist
Jul 18, 2019 . 1 changed file with 8 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,22 +1,24 @@ main() { var p2 = '/Images/png/yw_icon.png'; var p3 = 'Images/png/yw_icon.png'; var rs = [ 'http://61.183.0.23/gzzs/appstore.aspx?d=18', 'https://13.cn.123/root/', 'https://13.cn.123/api', 'ftp://123.23.132/', 'wx://123/23', p2, p3 ]; for (var r in rs) { print('--------$r-'); var uri = Uri.parse(r); print('绝对 ${uri.isAbsolute},包含schema ${uri.hasScheme}| schema:${uri.scheme}'); print("""http: ${uri.isScheme('http')}, https: ${uri.isScheme('https')}, ftp: ${uri.isScheme('ftp')}, wx: ${uri.isScheme('wx')}"""); print(uri.resolve(p2)); print(uri.resolve(p3)); print(uri.resolve(r)); -
WangXinhai created this gist
Jul 18, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ main() { var rs = [ 'http://61.183.0.23/gzzs/appstore.aspx?d=18', 'https://13.cn.123/root/', 'https://13.cn.123/api', 'ftp://123.23.132/', 'wx://123/23' ]; var p2 = '/Images/png/yw_icon.png'; var p3 = 'Images/png/yw_icon.png'; for(var r in rs){ print('--------$r-'); var uri = Uri.parse(r); print('abs ${uri.isAbsolute},schema:${uri.scheme}'); print("""http: ${uri.isScheme('http')}, https: ${uri.isScheme('https')}, ftp: ${uri.isScheme('ftp')}, wx: ${uri.isScheme('wx')}"""); print(uri.resolve(p2)); print(uri.resolve(p3)); print(uri.resolve(r)); } }