Answers for "flutter get file name"

1

flutter get file name

import 'package:path/path.dart';

File file = new File("/dir1/dir2/file.ext");
String basename = basename(file.path);
# file.ext
Posted by: Guest on April-20-2021
0

get file name from path dart

void main() {
  var completePath = "/dev/dart/work/hello/app.dart";
  var fileName = (completePath.split('/').last);
  var filePath = completePath.replaceAll("/$fileName", '');
  print(fileName);
  print(filePath);
}
Posted by: Guest on September-12-2020
0

flutter file full name

File file = new File("/storage/emulated/0/Android/data/my_app/files/Pictures/ca04f332.png"); 
String fileName = file.path.split('/').last;

print(fileName);
Posted by: Guest on May-15-2020

Browse Popular Code Answers by Language