Deval Joshi
Deval Joshi

Reputation: 153

Error: Cannot run with sound null safety, because the following dependencies (flutter_absolute_path)

Does the flutter_absolute_path v1.0.6 dependency not support null safety? Is there any other solution to get absolute path of a file?

for (int i = 0; i < resultList.length; i++) {
   var path = await 
   FlutterAbsolutePath.getAbsolutePath(resultList[i].identifier);
   print(path + '**path**');
   f.add(File(path));
}

Upvotes: 3

Views: 905

Answers (1)

Jesus Loves You
Jesus Loves You

Reputation: 291

Try this plugin file_picker file_picker: ^3.0.3

//use this line to pick files
FilePickerResult? result = await FilePicker.platform.pickFiles();


//use this to process what file is returned
 if(result != null) {
   File file = File(result.files.single.path);
} else {
   // User canceled the picker
}

You can read about extra features here: https://pub.dev/packages/file_picker

Upvotes: 2

Related Questions