LoginSignup
0
0

More than 1 year has passed since last update.

flutterで相対パスを処理する

Last updated at Posted at 2022-08-28

パターン1

var httpsUri = Uri(
      scheme: 'https',
      host: 'example.com',
      path: '/page/',
    );
print(httpsUri);
httpsUri = httpsUri.resolve("../aaa.txt");
print(httpsUri);

もしくは

var httpsUri = Uri.parse("https://example.com/page/");
print(httpsUri);
httpsUri = httpsUri.resolve("../aaa.txt");
print(httpsUri);

結果

https://example.com/page/
https://example.com/aaa.txt

パターン2

var httpsUri = Uri.parse("https://example.com/page/bbb.txt");
print(httpsUri);
httpsUri = httpsUri.resolve("../aaa.txt");
print(httpsUri);

結果

https://example.com/page/bbb.txt
https://example.com/aaa.txt
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0