Fix null PlatformFIle.extension error when called on Web

This commit is contained in:
markgrancapal 2020-11-11 22:42:12 +08:00 committed by Miguel Ruivo
parent 7f8d801a81
commit d2d4de7bf8
3 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,6 @@
## 2.0.13
Updates `extension` helper getter to use the `name` property instead of `path`, since the latest isn't available on the Web, hence, the extension wouldn't be as well. Thank you @markgrancapal.
## 2.0.12
Android:

View File

@ -32,5 +32,5 @@ class PlatformFile {
final int size;
/// File extension for this file.
String get extension => path?.split('.')?.last;
String get extension => name?.split('.')?.last;
}

View File

@ -1,7 +1,7 @@
name: file_picker
description: A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extension filtering support.
homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker
version: 2.0.12
version: 2.0.13
dependencies:
flutter: