FlutterでFileのファイル名を取得するには

Posted by on Wed, Jul 25, 2018

pathパッケージをimportして、

import 'package:path/path.dart';

basenameを使う。

File file = File("dir/name.png");
print(basename(file.path));
/// output:
/// name.png

参考



comments powered by Disqus