diff --git a/example/android/build.gradle b/example/android/build.gradle index 1202707..98d48cc 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -25,6 +25,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/lib/screens/file_explorer/file_explorer_card.dart b/example/lib/screens/file_explorer/file_explorer_card.dart index baf2f03..1bcbda0 100644 --- a/example/lib/screens/file_explorer/file_explorer_card.dart +++ b/example/lib/screens/file_explorer/file_explorer_card.dart @@ -430,7 +430,7 @@ class _FileExplorerCardState extends State { if (_expanded) ...[ _buildThumbnail(size: 50), _buildDocumentMetadata(), - _buildAvailableActions() + _buildAvailableActions(), ] else _buildDocumentSimplifiedTile(), ], diff --git a/example/lib/screens/file_explorer/file_explorer_page.dart b/example/lib/screens/file_explorer/file_explorer_page.dart index 85ee49b..141e209 100644 --- a/example/lib/screens/file_explorer/file_explorer_page.dart +++ b/example/lib/screens/file_explorer/file_explorer_page.dart @@ -181,7 +181,7 @@ class _FileExplorerPageState extends State { _buildDocumentList() else _buildEmptyFolderWarning(), - ] + ], ], ); } diff --git a/example/lib/screens/granted_uris/granted_uri_card.dart b/example/lib/screens/granted_uris/granted_uri_card.dart index 38e87e8..52ac51f 100644 --- a/example/lib/screens/granted_uris/granted_uri_card.dart +++ b/example/lib/screens/granted_uris/granted_uri_card.dart @@ -69,7 +69,7 @@ class _GrantedUriCardState extends State { ActionButton( 'Open file picker here', onTap: () => openDocumentTree(initialUri: widget.permissionUri.uri), - ) + ), ]; } @@ -193,7 +193,7 @@ class _GrantedUriCardState extends State { didUpdateDocument: (updatedDocumentFile) { documentFile = updatedDocumentFile; }, - ) + ), ], ); } diff --git a/lib/src/common/functional_extender.dart b/lib/src/common/functional_extender.dart index 91b1f70..2f58b51 100644 --- a/lib/src/common/functional_extender.dart +++ b/lib/src/common/functional_extender.dart @@ -25,7 +25,15 @@ extension FunctionalExtender on T? { T? takeIf(bool Function(T) f) { final T? self = this; - return self != null && f(self) ? self : null; + if (self == null) { + return null; + } + + if (f(self)) { + return self; + } + + return null; } } diff --git a/pubspec.yaml b/pubspec.yaml index d332239..4de8640 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: shared_storage description: "Flutter plugin to work with external storage and privacy-friendly APIs." -version: 0.8.0 +version: 0.8.1 homepage: https://github.com/alexrintt/shared-storage repository: https://github.com/alexrintt/shared-storage issue_tracker: https://github.com/alexrintt/shared-storage/issues